From b69daff672184a6149475c759fd4a6863a7f8f7f Mon Sep 17 00:00:00 2001 From: Hashim1999164 <64767361+Hashim1999164@users.noreply.github.com> Date: Thu, 13 Aug 2026 16:20:39 +0500 Subject: [PATCH] Stop importing Testing from ContainerTestSupport --- Sources/ContainerTestSupport/BuildFixture.swift | 9 ++++++--- .../ContainerFixture+ImageHelpers.swift | 5 +++-- .../ContainerFixture+MachineHelpers.swift | 1 - Sources/ContainerTestSupport/ContainerFixture.swift | 1 - 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/Sources/ContainerTestSupport/BuildFixture.swift b/Sources/ContainerTestSupport/BuildFixture.swift index f317c2fb9..7ad95191e 100644 --- a/Sources/ContainerTestSupport/BuildFixture.swift +++ b/Sources/ContainerTestSupport/BuildFixture.swift @@ -18,7 +18,6 @@ import ContainerizationExtras import Darwin import Foundation import SystemPackage -import Testing // MARK: - Build context types @@ -309,12 +308,16 @@ extension ContainerFixture { /// Asserts that `path` exists as a regular file inside `container`. public func assertContainerHasFile(_ container: String, at path: String, _ comment: String? = nil) throws { let exists = try containerHasFile(container, at: path) - #expect(exists, "\(comment ?? path) should exist in container") + guard exists else { + throw CommandError.executionFailed("\(comment ?? path) should exist in container") + } } /// Asserts that `path` does NOT exist inside `container`. public func assertContainerMissingFile(_ container: String, at path: String, _ comment: String? = nil) throws { let exists = try containerHasFile(container, at: path) - #expect(!exists, "\(comment ?? path) should NOT exist in container") + guard !exists else { + throw CommandError.executionFailed("\(comment ?? path) should NOT exist in container") + } } } diff --git a/Sources/ContainerTestSupport/ContainerFixture+ImageHelpers.swift b/Sources/ContainerTestSupport/ContainerFixture+ImageHelpers.swift index ffdc48db7..8aadcfbf1 100644 --- a/Sources/ContainerTestSupport/ContainerFixture+ImageHelpers.swift +++ b/Sources/ContainerTestSupport/ContainerFixture+ImageHelpers.swift @@ -16,7 +16,6 @@ import Foundation import SystemPackage -import Testing // MARK: - Image inspect types @@ -109,6 +108,8 @@ extension ContainerFixture { /// Asserts that the image was successfully built and is present in the image store. public func assertImageBuilt(_ image: String) throws { let name = try inspectImage(image) - #expect(name == image, "expected image \(image) to be present") + guard name == image else { + throw CommandError.executionFailed("expected image \(image) to be present") + } } } diff --git a/Sources/ContainerTestSupport/ContainerFixture+MachineHelpers.swift b/Sources/ContainerTestSupport/ContainerFixture+MachineHelpers.swift index 13e3ca9c7..8c5898605 100644 --- a/Sources/ContainerTestSupport/ContainerFixture+MachineHelpers.swift +++ b/Sources/ContainerTestSupport/ContainerFixture+MachineHelpers.swift @@ -15,7 +15,6 @@ //===----------------------------------------------------------------------===// import Foundation -import Testing // MARK: - Machine output types diff --git a/Sources/ContainerTestSupport/ContainerFixture.swift b/Sources/ContainerTestSupport/ContainerFixture.swift index 7431c642f..32a763129 100644 --- a/Sources/ContainerTestSupport/ContainerFixture.swift +++ b/Sources/ContainerTestSupport/ContainerFixture.swift @@ -20,7 +20,6 @@ import Foundation import Logging import Synchronization import SystemPackage -import Testing /// Per-test fixture for CLI integration tests. ///