cargo2junit

Crates.iocargo2junit
lib.rscargo2junit
version0.1.13
sourcesrc
created_at2019-02-16 22:58:20.594814
updated_at2023-04-02 23:57:33.118813
descriptionConverts cargo's json output (from stdin) to JUnit XML (to stdout)
homepage
repositoryhttps://github.com/johnterickson/cargo2junit
max_upload_size
id115262
size733,321
John Erickson (johnterickson)

documentation

README

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()
Commit count: 108

cargo fmt