Skip to content

Fixup some build warnings in tests #8184

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Tests/CommandsTests/BuildCommandTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ final class BuildCommandTests: CommandsTestCase {
stderr.contains(
"error: Target A imports another target (B) in the package without declaring it a dependency."
),
"got stdout: \(stdout), stderr: \(stderr)"
"got stdout: \(String(describing: stdout)), stderr: \(String(describing: stderr))"
)
}
}
Expand All @@ -159,7 +159,7 @@ final class BuildCommandTests: CommandsTestCase {
stderr.contains(
"warning: Target A imports another target (B) in the package without declaring it a dependency."
),
"got stdout: \(stdout), stderr: \(stderr)"
"got stdout: \(String(describing: stdout)), stderr: \(String(describing: stderr))"
)
}
}
Expand Down
10 changes: 5 additions & 5 deletions Tests/CommandsTests/PackageCommandTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2522,27 +2522,27 @@ final class PackageCommandTests: CommandsTestCase {

// Overall configuration: debug, plugin build request: debug -> without testability
try await fixture(name: "Miscellaneous/Plugins/CommandPluginTestStub") { fixturePath in
try await XCTAssertAsyncNoThrow(try await SwiftPM.Package.execute(["-c", "debug", "check-testability", "InternalModule", "debug", "true"], packagePath: fixturePath))
await XCTAssertAsyncNoThrow(try await SwiftPM.Package.execute(["-c", "debug", "check-testability", "InternalModule", "debug", "true"], packagePath: fixturePath))
}

// Overall configuration: debug, plugin build request: release -> without testability
try await fixture(name: "Miscellaneous/Plugins/CommandPluginTestStub") { fixturePath in
try await XCTAssertAsyncNoThrow(try await SwiftPM.Package.execute(["-c", "debug", "check-testability", "InternalModule", "release", "false"], packagePath: fixturePath))
await XCTAssertAsyncNoThrow(try await SwiftPM.Package.execute(["-c", "debug", "check-testability", "InternalModule", "release", "false"], packagePath: fixturePath))
}

// Overall configuration: release, plugin build request: debug -> with testability
try await fixture(name: "Miscellaneous/Plugins/CommandPluginTestStub") { fixturePath in
try await XCTAssertAsyncNoThrow(try await SwiftPM.Package.execute(["-c", "release", "check-testability", "InternalModule", "debug", "true"], packagePath: fixturePath))
await XCTAssertAsyncNoThrow(try await SwiftPM.Package.execute(["-c", "release", "check-testability", "InternalModule", "debug", "true"], packagePath: fixturePath))
}

// Overall configuration: release, plugin build request: release -> with testability
try await fixture(name: "Miscellaneous/Plugins/CommandPluginTestStub") { fixturePath in
try await XCTAssertAsyncNoThrow(try await SwiftPM.Package.execute(["-c", "release", "check-testability", "InternalModule", "release", "false"], packagePath: fixturePath))
await XCTAssertAsyncNoThrow(try await SwiftPM.Package.execute(["-c", "release", "check-testability", "InternalModule", "release", "false"], packagePath: fixturePath))
}

// Overall configuration: release, plugin build request: release including tests -> with testability
try await fixture(name: "Miscellaneous/Plugins/CommandPluginTestStub") { fixturePath in
try await XCTAssertAsyncNoThrow(try await SwiftPM.Package.execute(["-c", "release", "check-testability", "all-with-tests", "release", "true"], packagePath: fixturePath))
await XCTAssertAsyncNoThrow(try await SwiftPM.Package.execute(["-c", "release", "check-testability", "all-with-tests", "release", "true"], packagePath: fixturePath))
}
}

Expand Down
14 changes: 7 additions & 7 deletions Tests/FunctionalTests/TraitTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import XCTest
final class TraitTests: XCTestCase {
func testTraits_whenNoFlagPassed() async throws {
try await fixture(name: "Traits") { fixturePath in
let (stdout, stderr) = try await executeSwiftRun(fixturePath.appending("Example"), "Example")
let (stdout, _) = try await executeSwiftRun(fixturePath.appending("Example"), "Example")
// We expect no warnings to be produced. Specifically no unused dependency warnings.
// When fixed, GitHub issue #8131 should re-enable the below assert.
// XCTAssertFalse(stderr.contains("warning:"))
Expand All @@ -38,7 +38,7 @@ final class TraitTests: XCTestCase {

func testTraits_whenTraitUnification() async throws {
try await fixture(name: "Traits") { fixturePath in
let (stdout, stderr) = try await executeSwiftRun(fixturePath.appending("Example"), "Example", extraArgs: ["--traits", "default,Package9,Package10"])
let (stdout, _) = try await executeSwiftRun(fixturePath.appending("Example"), "Example", extraArgs: ["--traits", "default,Package9,Package10"])
// We expect no warnings to be produced. Specifically no unused dependency warnings.
// When fixed, GitHub issue #8131 should re-enable the below assert.
// XCTAssertFalse(stderr.contains("warning:"))
Expand All @@ -61,7 +61,7 @@ final class TraitTests: XCTestCase {

func testTraits_whenTraitUnification_whenSecondTraitNotEnabled() async throws {
try await fixture(name: "Traits") { fixturePath in
let (stdout, stderr) = try await executeSwiftRun(fixturePath.appending("Example"), "Example", extraArgs: ["--traits", "default,Package9"])
let (stdout, _) = try await executeSwiftRun(fixturePath.appending("Example"), "Example", extraArgs: ["--traits", "default,Package9"])
// We expect no warnings to be produced. Specifically no unused dependency warnings.
// When fixed, GitHub issue #8131 should re-enable the below assert.
// XCTAssertFalse(stderr.contains("warning:"))
Expand All @@ -82,7 +82,7 @@ final class TraitTests: XCTestCase {

func testTraits_whenIndividualTraitsEnabled_andDefaultTraits() async throws {
try await fixture(name: "Traits") { fixturePath in
let (stdout, stderr) = try await executeSwiftRun(fixturePath.appending("Example"), "Example", extraArgs: ["--traits", "default,Package5,Package7,BuildCondition3"])
let (stdout, _) = try await executeSwiftRun(fixturePath.appending("Example"), "Example", extraArgs: ["--traits", "default,Package5,Package7,BuildCondition3"])
// We expect no warnings to be produced. Specifically no unused dependency warnings.
// When fixed, GitHub issue #8131 should re-enable the below assert.
// XCTAssertFalse(stderr.contains("warning:"))
Expand Down Expand Up @@ -119,7 +119,7 @@ final class TraitTests: XCTestCase {

func testTraits_whenIndividualTraitsEnabled_andDefaultTraitsDisabled() async throws {
try await fixture(name: "Traits") { fixturePath in
let (stdout, stderr) = try await executeSwiftRun(fixturePath.appending("Example"), "Example", extraArgs: ["--traits", "Package5,Package7"])
let (stdout, _) = try await executeSwiftRun(fixturePath.appending("Example"), "Example", extraArgs: ["--traits", "Package5,Package7"])
// We expect no warnings to be produced. Specifically no unused dependency warnings.
// When fixed, GitHub issue #8131 should re-enable the below assert.
// XCTAssertFalse(stderr.contains("warning:"))
Expand All @@ -137,7 +137,7 @@ final class TraitTests: XCTestCase {

func testTraits_whenAllTraitsEnabled() async throws {
try await fixture(name: "Traits") { fixturePath in
let (stdout, stderr) = try await executeSwiftRun(fixturePath.appending("Example"), "Example", extraArgs: ["--enable-all-traits"])
let (stdout, _) = try await executeSwiftRun(fixturePath.appending("Example"), "Example", extraArgs: ["--enable-all-traits"])
// We expect no warnings to be produced. Specifically no unused dependency warnings.
// GitHub issue #8131
// XCTAssertFalse(stderr.contains("warning:"))
Expand All @@ -163,7 +163,7 @@ final class TraitTests: XCTestCase {

func testTraits_whenAllTraitsEnabled_andDefaultTraitsDisabled() async throws {
try await fixture(name: "Traits") { fixturePath in
let (stdout, stderr) = try await executeSwiftRun(fixturePath.appending("Example"), "Example", extraArgs: ["--enable-all-traits", "--disable-default-traits"])
let (stdout, _) = try await executeSwiftRun(fixturePath.appending("Example"), "Example", extraArgs: ["--enable-all-traits", "--disable-default-traits"])
// We expect no warnings to be produced. Specifically no unused dependency warnings.
// GitHub issue #8131
// XCTAssertFalse(stderr.contains("warning:"))
Expand Down
1 change: 0 additions & 1 deletion Tests/WorkspaceTests/WorkspaceTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8684,7 +8684,6 @@ final class WorkspaceTests: XCTestCase {

let maxConcurrentRequests = 2
let concurrentRequests = ThreadSafeBox(0)
let concurrentRequestsLock = NSLock()

var configuration = HTTPClient.Configuration()
configuration.maxConcurrentRequests = maxConcurrentRequests
Expand Down