Skip to content

Add junitxml2subunit script for JUnit XML test reports#104

Merged
jelmer merged 1 commit intomasterfrom
junitxml2subunit
Apr 27, 2026
Merged

Add junitxml2subunit script for JUnit XML test reports#104
jelmer merged 1 commit intomasterfrom
junitxml2subunit

Conversation

@jelmer
Copy link
Copy Markdown
Member

@jelmer jelmer commented Apr 27, 2026

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 time attribute so consumers can recover the duration. and 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.

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.
@jelmer jelmer force-pushed the junitxml2subunit branch from 6cb0835 to e4d7f2a Compare April 27, 2026 13:14
@jelmer jelmer merged commit ef77869 into master Apr 27, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant