-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Don't stomp on xUnit output from XCTest when running Swift Testing. #7796
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
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This PR forces Swift Testing to write its xUnit output to a different path from what the user specifies. In the future, we should have the two testing libraries collate their XML output into a single file, but that requires the ability to parse and reformat XML output and that's a little beyond the capabilities of this feature right now. Since we expect most uses of xUnit output right now are existing ones with existing XCTest-based tests, moving Swift Testing aside seems like the right call. (If XCTest is explicitly disabled, the exact specified path is used.)
@swift-ci please test |
@swift-ci please test |
@swift-ci please test Windows |
xedin
approved these changes
Jul 18, 2024
@swift-ci please test |
@swift-ci please test Windows |
@swift-ci please test Windows |
grynspan
added a commit
that referenced
this pull request
Jul 19, 2024
…7796) This PR forces Swift Testing to write its xUnit output to a different path from what the user specifies. In the future, we should have the two testing libraries collate their XML output into a single file, but that requires the ability to parse and reformat XML output and that's a little beyond the capabilities of this feature right now. Since we expect most uses of xUnit output right now are existing ones with existing XCTest-based tests, moving Swift Testing aside seems like the right call. (If XCTest is explicitly disabled, the exact specified path is used.)
grynspan
added a commit
that referenced
this pull request
Jul 19, 2024
…Swift Testing enabled by default.) (#7794) **Explanation:** Refactors the previously-experimental Swift Testing support logic so that only a single build product is produced when using both XCTest and Swift Testing, and detection of Swift Testing usage is no longer needed at compile time. **Scope:** Implementation of Swift Testing/SwiftPM integration; touches mostly `swift test` but affects `swift build` and `swift package init` as well. **Issue:** rdar://120864035 **Original PR:** #7777, #7789, #7796 **Risk:** Moderate—refactors how we build and run tests. **Testing:** Existing test coverage in the package as well as test coverage in the Swift Testing package; additional integration testing will be added once Swift Testing is in the toolchain. **Reviewer:** @bnbarham @xedin @briancroom @dennisweissmann --------- Co-authored-by: Pavel Yaskevich <[email protected]>
grynspan
added a commit
that referenced
this pull request
Aug 1, 2024
A previous PR, #7796, avoided Swift Testing stomping on XML output from XCTest when both libraries were running tests. However, there's a bug in the implementation where if you pass `--disable-xctest`, we don't end up telling Swift Testing to write any XML at all. This PR fixes that.
grynspan
added a commit
that referenced
this pull request
Aug 1, 2024
…d. (#7849) A previous PR, #7796, avoided Swift Testing stomping on XML output from XCTest when both libraries were running tests. However, there's a bug in the implementation where if you pass `--disable-xctest`, we don't end up telling Swift Testing to write any XML at all. This PR fixes that. Tested with: ```sh swift build $(pwd)/.build/debug/swift-test --package-path /Volumes/Dev/Source/swift-testing --disable-xctest --xunit-output /dev/stdout ``` To confirm that XML output was produced for Swift Testing's test target (as an exemplar package that uses Swift Testing.)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR forces Swift Testing to write its xUnit output to a different path from what the user specifies.
In the future, we should have the two testing libraries collate their XML output into a single file, but that requires the ability to parse and reformat XML output and that's a little beyond the capabilities of this feature right now. Since we expect most uses of xUnit output right now are existing ones with existing XCTest-based tests, moving Swift Testing aside seems like the right call.
(If XCTest is explicitly disabled, the exact specified path is used.)