I have a project ASP.NET core which I integrate unit test with xUnit , Everything work fine but I want to genrate xml report test to integrate in jenkins . Any help please :)
My project.json is :
{
"version": "1.0.0-*",
"testRunner": "xunit",
"dependencies": {
"xunit": "2.2.0-beta2-build3300",
"Microsoft.NETCore.App": "1.1.0",
"dotnet-test-xunit": "2.2.0-preview2-build1029"
},
"frameworks": {
"netcoreapp1.0": {
"dependencies": {
}
}
},
"runtimes": {
"ubuntu.16.04-x64": {},
"win10-x64": {},
"debian.8-x64": {},
"win81-x64": {}
}
}
I'm using the plugin xunit jenkins to display my result test . If their are another way tell me .
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
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:
add NunitXml.TestLogger package to the test project
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With