Skip to content

Add swift test --no-parallel #7231

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 2 commits into from
Jan 8, 2024
Merged

Conversation

grynspan
Copy link
Contributor

@grynspan grynspan commented Jan 5, 2024

This PR makes the --parallel flag on the swift-test subtool invertible with a "no" prefix.

We want swift-testing to default to enabling parallelization, but we don't want to break XCTest (which for historical reasons strongly prefers serial testing.) Deprecating --parallel and replacing it with --{enable,disable}-parallelism or similar seems a bit heavy-handed. Swift Argument Parser gives us the option to use a "no" prefix instead which means that the existing --parallel option will continue to work as intended.

Support for --no-parallel in swift-testing is here: swiftlang/swift-testing#174

This PR makes the `--parallel` flag on the swift-test subtool invertible with a "no" prefix.

We want swift-testing to default to enabling parallelization, but we don't want to break XCTest (which for historical reasons strongly prefers serial testing.) Deprecating `--parallel` and replacing it with `--{enable,disable}-parallelism` or similar seems a bit heavy-handed. Swift Argument Parser gives us the option to use a "no" prefix instead which means that the existing `--parallel` option will continue to work as intended.
@grynspan
Copy link
Contributor Author

grynspan commented Jan 5, 2024

@swift-ci please test

grynspan added a commit to swiftlang/swift-testing that referenced this pull request Jan 5, 2024
This PR enables parallelization by default when using `swift test` and enables support for the `--no-parallel` flag in `swift test` added in swiftlang/swift-package-manager#7231.

The default value of `Configuration.isParallelizationEnabled` remains `false`. Other adopters are free to enable or disable parallelization by default.

`XCTestScaffold` is not affected. It is a shim used with XCTest in Swift 5.10 only and expects serial execution of tests.
grynspan added a commit to swiftlang/swift-testing that referenced this pull request Jan 6, 2024
This PR enables parallelization by default when using `swift test` and enables support for the `--no-parallel` flag in `swift test` added in swiftlang/swift-package-manager#7231.

The default value of `Configuration.isParallelizationEnabled` remains `false`. Other adopters are free to enable or disable parallelization by default.

`XCTestScaffold` is not affected. It is a shim used with XCTest in Swift 5.10 only and expects serial execution of tests.
@MaxDesiatov MaxDesiatov added swift test Changes impacting `swift test` tool enhancement labels Jan 8, 2024
@grynspan grynspan merged commit 4041630 into main Jan 8, 2024
@grynspan grynspan deleted the jgrynspan/test-parallelization-toggle branch January 8, 2024 17:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement swift test Changes impacting `swift test` tool
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants