feat(reports): JUnit XML with per-file suites, classname and system-out - #1051
Merged
Conversation
One <testsuite> per test file (own counts, time, timestamp) instead of a single flat suite, because per-suite grouping is the unit Jenkins, GitLab, Azure and dorny/test-reporter organise results by. Every <testcase> carries classname (dotted file path), name, file and time. <failure> now puts the first informative line of the real message in the message attribute (skipping the "✗ Failed:" banner that repeats the name) with type="AssertionFailed" and the full text in the body. The test's captured output is retained through a new reports column -- spooled across the --parallel fork boundary like the rest -- and lands in <system-out> when non-empty. Per-testcase times are now formatted in pure bash with a literal dot, which removes the per-testcase awk fork the #912 locale workaround guarded. Closes #1016
10 tasks
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
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.
🤔 Background
Related #1016
The JUnit report was a single flat
<testsuite>with noclassname, a constantmessage="Test failed"and no captured output, so Jenkins, GitLab, Azure anddorny/test-reportercollapsed every run into one undifferentiated bucket.💡 Changes
<testsuite>per test file with its own counts, time and timestamp; aggregate totals move to<testsuites><testcase>getsclassname(dotted file path),name,fileandtime;<failure message>carries the first informative line of the real message withtype="AssertionFailed"and the full text in the body--parallelfork boundary, fix(reports): every report format is empty under --parallel #1004 guard) and emitted as<system-out>when non-emptyawkfork the 7 test failures on Bash 5.3 macOS (nix-shell) #912 locale workaround existed for; existing ANSI/control/XML escaping unchanged