How to run XUnit Tests with Jenkins

The xUnit Jenkins Plugin now supports xUnit.net:

Version 1.93
* Added support for xUnit.net v2


No, there is not a Jenkins plugin for executing xUnit.net tests.

The simplest way will be to run a Windows batch command within a Jenkins job.

You can at least use the xUnit plugin to parse the test results XML file from xUnit.net and update the build outcome based on whether all tests passed or not.


You can make it work with xUnit Jenkins plugin.

1) Have xUnit plugin installed.
2) In your pipeline save an xml file with xUnit results (I used https://github.com/Faizan2304/LoggerExtensions to make it work with "dotnet test" command).
3) Publish results with this code:

step([$class: 'XUnitBuilder',
    thresholds: [[$class: 'FailedThreshold', unstableThreshold: '1']],
    tools: [[$class: 'XUnitDotNetTestType', pattern: '{path to your xml file}']]])