NUnit
A guide for generating Trunk-compatible test reports for NUnit
1. Install NUnit XML Test Result Adapter
Ensure you have NUnit3TestAdapter, which allows NUnit to output results in JUnit XML format:
2. Run Tests with JUnitXML Output
This generates a .trx file in the test project’s output folder.
3. Convert .trx
to JUnit.xml format
.trx
to JUnit.xml formatNUnit does not output JUnit format directly, so you need to convert the .trx
file to JUnit XML. Use the trx2junit
tool:
Install trx2junit
using:
Convert the .trx file to a JUnit.xml using:
4. Output Location
The JUnit report will be written to the location of the source .trx
file. In the example above, it would be at test-results.xml
.
Disable Retries
You need to disable automatic retries if you previously included them. Retries compromise the accurate detection of flaky tests.
Omit [Retry(n)]
from tests to disable retries.
Next Step
JUnit files generated with NUnit are compatible with Trunk Flaky Tests. See CI Providers for a guide on how to upload test results to Trunk.
Last updated