Reputation: 2478
dotnet test
uses trx output by default. I am using trx2junit to convert it to junit, but this complicates CI setup.
Is it possible to output test report in junit format directly from dotnet test?
Upvotes: 8
Views: 10275
Reputation: 972
dotnet add package JUnitXml.TestLogger
dotnet test --logger:junit
This will create the test result file in
<csproj-dir>\TestResults\TestResults.xml
To name the result file different, execute the test with i.e.
dotnet test --logger:"junit;LogFileName=my-test-results.xml"
Upvotes: 1
Reputation: 899
anyone knows how to install junit logger (if it is possible ?) on system that can be enumerated via this command ?
I find the need to install package on csproj quite crappy
Upvotes: 0
Reputation: 38497
Install the NuGet package to your test project:
<PackageReference Include="JunitXml.TestLogger" Version="3.0.110" />
Run the following command to output the test results in JUnit XML format:
dotnet test --logger:junit
More info here:
Upvotes: 15