How to get a TRX file
TRX is the Visual Studio test results format. The .NET CLI writes it through the TRX logger:
dotnet test --logger trx
dotnet test --logger "trx;logfilename=testResults.trx"By default the file lands in a TestResults folder in the directory that contains the test project. With vstest.console.exe, the same logger is /logger:trx, and a relative LogFileName is resolved against that TestResults folder.
What the viewer reads
A TRX file keeps results and test definitions apart, and the viewer joins them:
Outcomes map to four results. Passed is a pass. Failed is a failure. Timeout, Aborted and Disconnected mean the test didn't finish on its own, so the viewer counts them as errors rather than assertion failures. NotExecuted, NotRunnable and Inconclusive count as skipped. A test that timed out after a minute is worth a different fix than one with a wrong value, which is why the two are kept apart.
Reading TRX without Visual Studio
Visual Studio opens TRX files, and Azure Pipelines publishes them, but on a Mac, on Linux or in a hurry the file is just XML. This page shows the failures grouped by message, the slowest tests and a per-class table, with the stack trace one click away. For results from several test projects, drop all their TRX files at once and the viewer merges them.
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