Add junitxml2subunit script for JUnit XML test reports#104
Merged
Conversation
JUnit XML is the de-facto interchange format for JVM test runners (Maven Surefire, Gradle, Ant) and many other ecosystems. Both Maven and Gradle write one XML file per test class into a reports directory, so the script accepts directories (`-d DIR`) as well as individual files and walks each directory in lexical order for a deterministic stream. Each <testcase> becomes a paired inprogress/terminal subunit packet, spaced by the testcase's `time` attribute so consumers can recover the duration. <failure> and <error> children both map to subunit `fail` (subunit has no separate "error" status that maps cleanly, and from a consumer's perspective both mean "did not pass"); their `type`/`message` attributes plus body text are folded into a single text/plain attachment on the terminal packet.
6cb0835 to
e4d7f2a
Compare
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.
JUnit XML is the de-facto interchange format for JVM test runners (Maven Surefire, Gradle, Ant) and many other ecosystems. Both Maven and Gradle write one XML file per test class into a reports directory, so the script accepts directories (
-d DIR) as well as individual files and walks each directory in lexical order for a deterministic stream.Each becomes a paired inprogress/terminal subunit packet, spaced by the testcase's
timeattribute so consumers can recover the duration. and children both map to subunitfail(subunit has no separate "error" status that maps cleanly, and from a consumer's perspective both mean "did not pass"); theirtype/messageattributes plus body text are folded into a single text/plain attachment on the terminal packet.