Skip to content
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

Test: Convert more tests to Swift Testing #8100

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

bkhouri
Copy link
Contributor

@bkhouri bkhouri commented Nov 5, 2024

Convert additional suites from XCTest to Swift Testing

Motivation:

The XCTest run, by default, sequentially. Convert some suites from XCTest to Swift Testing to make use of parallel execution and, in some cases, test parameterization.

Not all Test Suite in the respective folders have been converted as some use helpers in swift-tools-core-support, which don't have a matching swift testing helper.

Modifications:

Convert XCTest to Swift Testing

Result:

Ran the equivalent of the following and ensured there were no test-related failures

for _ in $(seq 0 100);
do
    swift test --enable-swift-testing --disable-xctest
done

Depends on #8099
Blocked by #8137
Requires swiftlang/swift#78300

@bkhouri bkhouri changed the title Test: Convert more tests to Swift Testing [DRAFT] Test: Convert more tests to Swift Testing Nov 5, 2024
@bkhouri bkhouri changed the title [DRAFT] Test: Convert more tests to Swift Testing Test: Convert more tests to Swift Testing Nov 7, 2024
@bkhouri bkhouri marked this pull request as ready for review November 7, 2024 13:12
@bkhouri
Copy link
Contributor Author

bkhouri commented Nov 7, 2024

Ready for review, though it may be blocked as not all pipeline builds run with Swift 6.0!

@bkhouri
Copy link
Contributor Author

bkhouri commented Nov 8, 2024

Ready for review, though it may be blocked as not all pipeline builds run with Swift 6.0!

Looks like the Selft-hosted macOS pipeline is now running the nightly build
https://ci.swift.org/job/swift-package-manager-with-xcode-self-hosted-PR-osx/4511/execution/node/49/log/

@@ -43,17 +45,19 @@ final class SigningIdentityTests: XCTestCase {
_ = SwiftSigningIdentity(certificate: certificate, privateKey: Certificate.PrivateKey(privateKey))

// Test public API
XCTAssertNoThrow(
#expect(throws: Never.self) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just throw.

@bkhouri bkhouri marked this pull request as draft November 14, 2024 17:54
@bkhouri bkhouri force-pushed the t/main/convert_more_suites_to_swift_testing branch 4 times, most recently from a3ff42c to ea6c8e8 Compare November 21, 2024 15:38
@bkhouri
Copy link
Contributor Author

bkhouri commented Nov 22, 2024

This PR is blocked by #8137

Add helpers related to the current platform to assist with conditionally
running test cases.
Convert additional test from XCTest to Swift Testing to make use of
parallel execution and, in some cases, test parameterization.

Not all Test Suite in the respective folders have been converted as some
use helpers in swift-tools-core-support, which don't have a matching
swift testing helper.
@bkhouri bkhouri force-pushed the t/main/convert_more_suites_to_swift_testing branch from ea6c8e8 to 930ee2e Compare December 3, 2024 18:04
@shahmishal
Copy link
Member

@swift-ci Please test nightly self hosted

@bkhouri bkhouri marked this pull request as ready for review December 19, 2024 01:25
@bkhouri bkhouri added the test suite improvements to SwiftPM test suite label Dec 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
test suite improvements to SwiftPM test suite
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants