Skip to content

Parallelize tests by default. #174

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
Jan 6, 2024

Conversation

grynspan
Copy link
Contributor

@grynspan grynspan commented 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.

Checklist:

  • Code and documentation should follow the style of the Style Guide.
  • If public symbols are renamed or modified, DocC references should be updated.

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 grynspan self-assigned this Jan 5, 2024
@grynspan grynspan added enhancement New feature or request concurrency 🔀 Swift concurrency/sendability issues swiftpm-integration 📦 Swift Package Manager integration labels Jan 5, 2024
@grynspan
Copy link
Contributor Author

grynspan commented Jan 5, 2024

@swift-ci please test

@shahmishal
Copy link
Member

@swift-ci test

@grynspan
Copy link
Contributor Author

grynspan commented Jan 5, 2024

@swift-ci please test

@grynspan
Copy link
Contributor Author

grynspan commented Jan 6, 2024

@swift-ci please test

@grynspan
Copy link
Contributor Author

grynspan commented Jan 6, 2024

Remaining failure is a SwiftPM regression tracked as rdar://120560817. All tests are passing in CI and it would be green except for a false EXIT_FAILURE from SwiftPM. Merging with failed CI.

@grynspan grynspan merged commit 19dcc69 into main Jan 6, 2024
@grynspan grynspan deleted the jgrynspan/test-parallelization-toggle branch January 6, 2024 15:13
grynspan added a commit to swiftlang/swift-package-manager that referenced this pull request Jan 8, 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
concurrency 🔀 Swift concurrency/sendability issues enhancement New feature or request swiftpm-integration 📦 Swift Package Manager integration
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants