#cargo #test #junit

app cargo2junit

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

10 releases

0.1.9 Oct 8, 2021
0.1.8 Oct 5, 2021
0.1.7 Feb 27, 2021
0.1.6 Jun 25, 2020
0.1.2 Feb 25, 2019

#29 in Testing

Download history 1565/week @ 2021-07-02 1901/week @ 2021-07-09 1913/week @ 2021-07-16 1598/week @ 2021-07-23 1875/week @ 2021-07-30 2098/week @ 2021-08-06 2261/week @ 2021-08-13 2078/week @ 2021-08-20 1537/week @ 2021-08-27 1494/week @ 2021-09-03 1920/week @ 2021-09-10 2760/week @ 2021-09-17 1936/week @ 2021-09-24 2525/week @ 2021-10-01 1998/week @ 2021-10-08 2534/week @ 2021-10-15

8,568 downloads per month

MIT license

74KB
412 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.8–2.8MB
~57K SLoC