#cargo #test #junit

app cargo2junit

Converts cargo’s json output (from stdin) to JUnit XML (to stdout)

13 releases

0.1.12 Jun 14, 2022
0.1.10 Jan 26, 2022
0.1.9 Oct 8, 2021
0.1.7 Feb 27, 2021
0.1.2 Feb 25, 2019

#15 in Testing

Download history 11764/week @ 2022-04-27 8934/week @ 2022-05-04 7678/week @ 2022-05-11 24004/week @ 2022-05-18 8841/week @ 2022-05-25 23082/week @ 2022-06-01 36961/week @ 2022-06-08 22946/week @ 2022-06-15 6708/week @ 2022-06-22 12945/week @ 2022-06-29 13551/week @ 2022-07-06 29980/week @ 2022-07-13 32846/week @ 2022-07-20 24188/week @ 2022-07-27 24938/week @ 2022-08-03 27778/week @ 2022-08-10

121,873 downloads per month

MIT license

74KB
493 lines

Build Status

cargo2junit

Converts cargo's json output (from stdin) to JUnit XML (to stdout).

To use, first install:

cargo install cargo2junit

Then, run cargo test and convert:

cargo test -- -Z unstable-options --format json --report-time | cargo2junit > results.xml

Or, use tee for streaming output to console as the tests run:

cargo test -- -Z unstable-options --format json --report-time | tee results.json
cat results.json | cargo2junit > results.xml

Once you have your XML, publish it (e.g. for Azure Pipelines):

  - task: PublishTestResults@2
    inputs: 
      testResultsFormat: 'JUnit'
      testResultsFiles: 'test_results.xml'
    condition: succeededOrFailed()

Dependencies

~1.4–2.1MB
~45K SLoC