Skip to content

Tests: Convert some WorkspaceTests module tests to Swift Testing #8092

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

Conversation

bkhouri
Copy link
Contributor

@bkhouri bkhouri commented Nov 1, 2024

Convert most of the WorkspaceTests from XCTests to Swift Testing to make use of parallelism and, in some cases, test parameterization.

Motivation:

The XCTest run, by default, sequentially. Convert most of the WorkspaceTests from XCTests to Swift Testing to make use of parallelism, and in some cases, parameterized test cases.

Not all Test Suites in WorkspaceTests have been converted as some use helpers in swift-tools-core-support, which don't have a matching Swift Testing helper.

Modifications:

Convert XCTests to Swift Testing

Result:

Ran the equivalent of

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

and ensured there were no test-related failures.

Blocked by #8137
Blocked on swiftlang/swift#78300
Blocked on swiftlang/swift#81217

@bkhouri bkhouri changed the title [DRAFT] Convert most WorkspaceTests to Swift Testing Convert most WorkspaceTests to Swift Testing Nov 7, 2024
@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/

@bkhouri bkhouri force-pushed the t/main/bkhouri_convert_Workspacetests_XCtests_to_swift_testing branch from 6d94d63 to f47210e Compare November 13, 2024 05:08
@plemarquand
Copy link
Contributor

@swift-ci test

@bkhouri bkhouri marked this pull request as draft November 14, 2024 17:55
@bkhouri bkhouri force-pushed the t/main/bkhouri_convert_Workspacetests_XCtests_to_swift_testing branch from f47210e to 9f5c767 Compare November 20, 2024 18:20
@shahmishal
Copy link
Member

@swift-ci test self hosted

@bkhouri bkhouri force-pushed the t/main/bkhouri_convert_Workspacetests_XCtests_to_swift_testing branch from 9f5c767 to 9fa6a3b Compare November 22, 2024 01:43
@shahmishal
Copy link
Member

@swift-ci test self hosted

1 similar comment
@shahmishal
Copy link
Member

@swift-ci test self hosted

@bkhouri
Copy link
Contributor Author

bkhouri commented Nov 22, 2024

This PR is blocked by #8137

@bkhouri bkhouri force-pushed the t/main/bkhouri_convert_Workspacetests_XCtests_to_swift_testing branch from ccedc33 to 1a15afb Compare February 11, 2025 15:31
@bkhouri
Copy link
Contributor Author

bkhouri commented Feb 13, 2025

Test with
swiftlang/swift#79330

@swift-ci please test linux

bripeticca pushed a commit to bripeticca/swift-package-manager that referenced this pull request Feb 28, 2025
Add a canary swift testing tests to ensure we do not regress.

This test will be removed sometime after swiftlang#8092, swiftlang#8093 or swiftlang#8100 are
merged
bripeticca pushed a commit to bripeticca/swift-package-manager that referenced this pull request Feb 28, 2025
Add a canary swift testing tests to ensure we do not regress.

This test will be removed sometime after swiftlang#8092, swiftlang#8093 or swiftlang#8100 are
merged

(cherry picked from commit 257e671)

Re-adds swiftlang#8222, after it was reverted in swiftlang#8266 
Depends on swiftlang/swift#79074
@bkhouri bkhouri force-pushed the t/main/bkhouri_convert_Workspacetests_XCtests_to_swift_testing branch from 1a15afb to 5b4e2a6 Compare April 7, 2025 13:35
@bkhouri bkhouri force-pushed the t/main/bkhouri_convert_Workspacetests_XCtests_to_swift_testing branch from 5b4e2a6 to d2c0549 Compare April 7, 2025 13:40
@bkhouri
Copy link
Contributor Author

bkhouri commented Apr 7, 2025

@swift-ci test linux

@bkhouri
Copy link
Contributor Author

bkhouri commented Apr 7, 2025

@swift-ci test

@bkhouri
Copy link
Contributor Author

bkhouri commented Apr 7, 2025

@swift-ci test self hosted windows

@bkhouri bkhouri changed the title Convert most WorkspaceTests to Swift Testing Tests: Convert most WorkspaceTests to Swift Testing Apr 7, 2025
@bkhouri
Copy link
Contributor Author

bkhouri commented Apr 7, 2025

@swift-ci test windows

@bkhouri bkhouri force-pushed the t/main/bkhouri_convert_Workspacetests_XCtests_to_swift_testing branch from d2c0549 to d39a015 Compare May 1, 2025 19:33
@bkhouri bkhouri changed the title Tests: Convert most WorkspaceTests to Swift Testing Tests: Convert some WorkspaceTests module tests to Swift Testing May 1, 2025
@bkhouri
Copy link
Contributor Author

bkhouri commented May 1, 2025

swiftlang/swift#81217

@swift-ci test

@bkhouri
Copy link
Contributor Author

bkhouri commented May 2, 2025

swiftlang/swift#81217

@swift-ci test windows

1 similar comment
@bkhouri
Copy link
Contributor Author

bkhouri commented May 2, 2025

swiftlang/swift#81217

@swift-ci test windows

@bkhouri
Copy link
Contributor Author

bkhouri commented May 2, 2025

@swift-ci test windows

@bkhouri bkhouri enabled auto-merge (squash) May 2, 2025 23:43
@bkhouri bkhouri disabled auto-merge May 2, 2025 23:43
Copy link
Contributor

@pmattos pmattos left a comment

Choose a reason for hiding this comment

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

Great stuff Sam... nice to see us adopting this.

Convert most of the WorkspaceTests from XCTests to Swift Testing to make
use of parallelism and, in some cases, test parameterization.

Not all Test Suites in WorkspaceTests 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/bkhouri_convert_Workspacetests_XCtests_to_swift_testing branch from d39a015 to da8bae8 Compare May 3, 2025 15:28
@bkhouri
Copy link
Contributor Author

bkhouri commented May 3, 2025

@swift-ci test

@bkhouri
Copy link
Contributor Author

bkhouri commented May 3, 2025

@swift-ci test windows

@bkhouri bkhouri merged commit 8694d3c into swiftlang:main May 4, 2025
6 checks passed
@bkhouri bkhouri deleted the t/main/bkhouri_convert_Workspacetests_XCtests_to_swift_testing branch May 4, 2025 17:43
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.

6 participants