Skip to content

Fixup warnings in tests #7963

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
Sep 13, 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/BasicsTests/AsyncProcessTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,7 @@ final class AsyncProcessTests: XCTestCase {

group.addTask {
var counter = 0
for await output in stderrStream {
for await _ in stderrStream {
counter += 1
}

Expand Down Expand Up @@ -477,7 +477,7 @@ final class AsyncProcessTests: XCTestCase {
},
stderr: { stderr in
var counter = 0
for await output in stderr {
for await _ in stderr {
counter += 1
}

Expand Down
2 changes: 1 addition & 1 deletion Tests/CommandsTests/TestCommandTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ final class TestCommandTests: CommandsTestCase {
try await fixture(name: "Miscellaneous/EmptyTestsPkg") { fixturePath in
let xUnitOutput = fixturePath.appending("result.xml")
// Run tests in parallel with verbose output.
let stdout = try await SwiftPM.Test.execute(["--parallel", "--verbose", "--xunit-output", xUnitOutput.pathString], packagePath: fixturePath).stdout
_ = try await SwiftPM.Test.execute(["--parallel", "--verbose", "--xunit-output", xUnitOutput.pathString], packagePath: fixturePath).stdout

// Check the xUnit output.
XCTAssertFileExists(xUnitOutput)
Expand Down
8 changes: 6 additions & 2 deletions Tests/FunctionalTests/PluginTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,8 @@ final class PluginTests: XCTestCase {
)

let toolSearchDirectories = [try UserToolchain.default.swiftCompilerPath.parentDirectory]
let success = try await withCheckedThrowingContinuation { plugin.invoke(
let success = try await withCheckedThrowingContinuation { continuation in
plugin.invoke(
action: .performCommand(package: package, arguments: arguments),
buildEnvironment: BuildEnvironment(platform: .macOS, configuration: .debug),
scriptRunner: scriptRunner,
Expand All @@ -555,7 +556,10 @@ final class PluginTests: XCTestCase {
observabilityScope: observability.topScope,
callbackQueue: delegateQueue,
delegate: delegate,
completion: $0.resume(with:))
completion: {
continuation.resume(with: $0)
}
)
}
if expectFailure {
XCTAssertFalse(success, "expected command to fail, but it succeeded", file: file, line: line)
Expand Down
6 changes: 4 additions & 2 deletions Tests/PackageRegistryTests/RegistryClientTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3840,14 +3840,16 @@ extension RegistryClient {
package: PackageIdentity.RegistryIdentity,
version: Version
) async throws -> PackageVersionMetadata {
return try await withCheckedThrowingContinuation {
return try await withCheckedThrowingContinuation { continuation in
self.getPackageVersionMetadata(
package: package.underlying,
version: version,
fileSystem: InMemoryFileSystem(),
observabilityScope: ObservabilitySystem.NOOP,
callbackQueue: .sharedConcurrent,
completion: $0.resume(with:)
completion: {
continuation.resume(with: $0)
}
)
}
}
Expand Down
6 changes: 4 additions & 2 deletions Tests/SourceControlTests/RepositoryManagerTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -698,15 +698,17 @@ extension RepositoryManager {
updateStrategy: RepositoryUpdateStrategy = .always,
observabilityScope: ObservabilityScope
) async throws -> RepositoryHandle {
return try await withCheckedThrowingContinuation {
return try await withCheckedThrowingContinuation { continuation in
self.lookup(
package: .init(url: SourceControlURL(repository.url)),
repository: repository,
updateStrategy: updateStrategy,
observabilityScope: observabilityScope,
delegateQueue: .sharedConcurrent,
callbackQueue: .sharedConcurrent,
completion: $0.resume(with:)
completion: {
continuation.resume(with: $0)
}
)
}
}
Expand Down
6 changes: 3 additions & 3 deletions Tests/WorkspaceTests/InitTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ final class InitTests: XCTestCase {
}

func testInitPackageLibraryWithSwiftTestingOnly() async throws {
try await testWithTemporaryDirectory { tmpPath in
try testWithTemporaryDirectory { tmpPath in
let fs = localFileSystem
let path = tmpPath.appending("Foo")
let name = path.basename
Expand Down Expand Up @@ -192,7 +192,7 @@ final class InitTests: XCTestCase {
}

func testInitPackageLibraryWithBothSwiftTestingAndXCTest() async throws {
try await testWithTemporaryDirectory { tmpPath in
try testWithTemporaryDirectory { tmpPath in
let fs = localFileSystem
let path = tmpPath.appending("Foo")
let name = path.basename
Expand Down Expand Up @@ -231,7 +231,7 @@ final class InitTests: XCTestCase {
func testInitPackageLibraryWithNoTests() async throws {
try UserToolchain.default.skipUnlessAtLeastSwift6()

try await testWithTemporaryDirectory { tmpPath in
try testWithTemporaryDirectory { tmpPath in
let fs = localFileSystem
let path = tmpPath.appending("Foo")
let name = path.basename
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -728,13 +728,15 @@ extension PackageContainerProvider {
for package: PackageReference,
updateStrategy: ContainerUpdateStrategy = .always
) async throws -> PackageContainer {
try await withCheckedThrowingContinuation {
try await withCheckedThrowingContinuation { continuation in
self.getContainer(
for: package,
updateStrategy: updateStrategy,
observabilityScope: ObservabilitySystem.NOOP,
on: .global(),
completion: $0.resume(with:)
completion: {
continuation.resume(with: $0)
}
)
}
}
Expand Down