How to get NUnit XML
The NUnit console runner saves its results to TestResult.xml in the NUnit 3 format when you don't give it a --result option. To choose the file or ask for the older format:
nunit3-console MyTests.dll --result=results.xml
nunit3-console MyTests.dll "--result=results-v2.xml;format=nunit2"The --result option can be repeated to write both formats in one run; quote it in a shell, since ; ends a command. Tests run through dotnet test and the NUnit adapter report through VSTest loggers instead, such as --logger trx; open those files in the TRX viewer.
What the viewer reads
In NUnit 3 XML, <test-run> holds nested <test-suite> elements (assembly, namespace, fixture) and the <test-case> elements inside them. Each test case has a result and, when the result alone isn't enough, a label:
result | label | Shown as |
|---|---|---|
| Passed | Passed | |
| Failed | (none) | Failed: an assertion failed |
| Failed | Error, Cancelled or Invalid | Error: an exception, a cancelled run or an invalid test |
| Skipped | Ignored or Explicit | Skipped, with the reason from <reason><message> |
| Inconclusive | Skipped |
The duration attribute is in seconds. The failure message and stack trace come from <failure><message> and <failure><stack-trace>, and the suite is the test case's classname, so parameterized cases such as AppliesCoupon(10) and AppliesCoupon(20) sit under one fixture.
NUnit 2 files (<test-results>, results such as Success and Failure, a time attribute) are read too, for older pipelines.
Sources
Testland for teams
In developmentAutomated test reports, manual test runs and regression tracking in one workspace. A separate product, built on the same skills.
One email when it opens, nothing else. Privacy policy