Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ To use, first install:
cargo install cargo2junit
```

## How to Get the JUnit XML Format
### When You Have the Nightly Compiler Version

Then, run cargo test either with `RUSTC_BOOTSTRAP=1` or with `+beta` and convert:
```
RUSTC_BOOTSTRAP=1 cargo test -- -Z unstable-options --format json --report-time | cargo2junit > results.xml
Expand All @@ -19,6 +22,19 @@ RUSTC_BOOTSTRAP=1 cargo test -- -Z unstable-options --format json --report-time
cat results.json | cargo2junit > results.xml
```

### When You Do Not Have the Nightly Compiler Version
If you do not have the nightly compiler release, the -Z option will not work. You can add it using the following:
```
rustup install nightly
```

And when you don't have it selected by default, you can use the +nightly argument:
```
cargo +nightly test -- --format json -Z unstable-options --report-time > test-results.json
cat test-results.json | cargo2junit > test-results.xml
```

## Publishing the XML to Azure Pipelines
Once you have your XML, publish it (e.g. for Azure Pipelines):
```
- task: PublishTestResults@2
Expand Down