-
Notifications
You must be signed in to change notification settings - Fork 1.4k
[SwiftTestTool] Add test failure messages to xUnit report #6174
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
Open
cyberowl
wants to merge
1
commit into
swiftlang:main
Choose a base branch
from
cyberowl:better-xunit-test-failures-report
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 file contains hidden or 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 file contains hidden or 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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this seems like an improvement over the hard coded "failed" message, but a bit fragile. @stmontgomery any advice?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It really should not be necessary to scrape the textual logging output of XCTests and parse it using regex. We have a proper API for observing events and retrieving this data in structured ways: XCTestObservation.
However, I think SwiftPM needs to coordinate doing this for it to be effective but it doesn't do that today. So I can understand why this approach relying on more-and-more intricate regex parsing is seen as the easiest solution at the moment. I believe SwiftPM already parses the textual logging output to a certain extent (right?), so this is only adding a bit more and I'm not going to stand in the way of landing this. But I think we really should spend some time building the necessary infrastructure for SwiftPM to coordinate more closely with the runner process to gather its results in a structured way, to avoid the need for any of this.
@tomerd Do you know if we already have an Issue tracking this sort of enhancement on the SwiftPM side?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@stmontgomery we have been pushing back on adding parsing of XCTest output and we would very much like to see a structured output from XCTest instead of the non-structured one we have now - it will help solve several issues. iirc we looked at this before and the conclusion was that the invocation of XCTest goes through several layers that essentially shell out so there is little room for setting up delegates etc, but maybe there was a flag we can pass to the process that can assist? open to ideas on how to be at achieve this