'How to log dotnet test output in junit format

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?



Solution 1:[1]

  1. Install the NuGet package to your test project:

    <PackageReference Include="JunitXml.TestLogger" Version="3.0.110" />
    
  2. Run the following command to output the test results in JUnit XML format:

    dotnet test --logger:junit
    

More info here:

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Muhammad Rehan Saeed