### Install cargo2junit Source: https://docs.rs/cargo2junit Install the cargo2junit tool using cargo. ```bash cargo install cargo2junit ``` -------------------------------- ### Publish Test Results in Azure Pipelines Source: https://docs.rs/cargo2junit Example of how to configure Azure Pipelines to publish JUnit test results. ```yaml - task: PublishTestResults@2 inputs: testResultsFormat: 'JUnit' testResultsFiles: 'test_results.xml' condition: succeededOrFailed() ``` -------------------------------- ### Run cargo test and convert to JUnit XML Source: https://docs.rs/cargo2junit Execute cargo tests with specific flags to output JSON, then pipe the output to cargo2junit for conversion to JUnit XML. ```bash RUSTC_BOOTSTRAP=1 cargo test -- -Z unstable-options --format json --report-time | cargo2junit > results.xml ``` -------------------------------- ### Stream cargo test output and convert to JUnit XML Source: https://docs.rs/cargo2junit Use tee to stream cargo test JSON output to both the console and a file, then convert the file to JUnit XML. ```bash RUSTC_BOOTSTRAP=1 cargo test -- -Z unstable-options --format json --report-time | tee results.json cat results.json | cargo2junit > results.xml ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.