Problem ¶
How to get dotnet test results collected by Jenkins?
Solution ¶
-
Make
dotnet testcreate logs:dotnet test --logger trxIn console output you should now see messages like:
Results File: ...\TestResults\a_long_file_name.trx -
Make Jenkins collect the results:
MSTest is the plugin that can consume
trxfiles. Make sure it’s installed.Add this line to your
Jenkinsfilebelow your tests execution:mstest testResultsFile:"**/*.trx", keepLongStdio: true
Notes ¶
You can run dotnet test on the whole solution. It generates a trx file per test project. The MSTest plugin collects all the files and creates an aggregated report accessible in Jenkins. This method is test-framework agnostic. I tested it with NUnit 3.