### Install cargo2junit Source: https://docs.rs/cargo2junit Install the cargo2junit tool using cargo. This is a prerequisite for using the conversion functionality. ```bash cargo install cargo2junit ``` -------------------------------- ### Publish Test Results in Azure Pipelines Source: https://docs.rs/cargo2junit Example of an Azure Pipelines task to publish JUnit test results. This task is configured to recognize the XML format generated by cargo2junit. ```yaml - task: PublishTestResults@2 inputs: testResultsFormat: 'JUnit' testResultsFiles: 'test_results.xml' condition: succeededOrFailed() ``` -------------------------------- ### Convert Cargo Test Output to JUnit XML Source: https://docs.rs/cargo2junit Run cargo tests with JSON output and pipe it to cargo2junit to generate a JUnit XML report. This is useful for integrating test results into CI systems. ```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 output to both the console and a file, then convert the saved JSON to JUnit XML. This allows for real-time viewing and later processing. ```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.