Generate result report testing with xunit using .NET core Generate result report testing with xunit using .NET core jenkins jenkins

Generate result report testing with xunit using .NET core


I had the same issue in .NET Core 2.0 and dotnet test does not have a -xml switch. So, I relied on a custom logger to do the job:

  1. add NunitXml.TestLogger package to the test project

  2. Run tests using this logger:

    dotnet test "project.csproj" --no-build --verbosity normal --logger:"nunit;LogFilePath=xunit_results.xml"

The output is compatible with NUnit results and be used to generate fancy reports like those obtained using ReportUnit.


I find the solution , just add -xml ./path/out.xml .It seems like this :

dotnet test ./WebApi.Tests/ -xml ./WebApi.Tests/out.xml


Old thread but can be useful.In .Net Core 3.1 you can use --logger html to get a read friendly report.dotnet test --logger html

Using:

.Net Core 3.1,Xunit 2.4.1