Rust

A guide for generating Trunk-compatible test reports for Rust

1. Generate JUnit

Use cargo-nextest to run your Rust tests and output JUnit reports. Add this to your nextest configuration:

[profile.ci.junit]
path = "junit.xml"

Run your tests with cargo-nextest specifying --profile ci to generate JUnit test reports.

cargo nextest run --profile ci

2. Output Location

When using a profile with JUnit support configured, a JUnit report will be written out to target/nextest/ci/junit.xml within the workspace root.

Disable Retries

You need to disable automatic retries if you previously enabled them. Retries compromise the accurate detection of flaky tests.

Omit the --retries option.

Next Step

JUnit files generated with cargo-nextest are compatible with Trunk Flaky Tests. See CI Providers for a guide on how to upload test results to Trunk.

Last updated