i have just started with XUnit and configuring Jenkins and i wanted to ask if there is a way to run XUnit Tests directly started by Jenkins and not with a windows batch command, that starts the console runner of XUnit.
I know there is the possibilty to run the XUnit tests by executing a Windows batch command via the Console Runner but im looking for a Plugin / whatever that for example includes the XUnit Runner and you only have to point to the dll so he starts the Tests and processes the XML output.
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.
We have created a new project ‘ TestNGProject ‘ with the configuration to run TestNG Tests using Jenkins. You could see in the below screenshot. Let’s execute it now. Click on ‘ Build Now ‘ button. It will invoke testng.xml from the batch file. Right click on Build Number (here in my case it is #1) and click on Console Output to see the result.
I know there is the possibilty to run the XUnit tests by executing a Windows batch command via the Console Runner but im looking for a Plugin / whatever that for example includes the XUnit Runner and you only have to point to the dll so he starts the Tests and processes the XML output. Show activity on this post.
In order to successfully run unit tests and code coverage analysis for a .NET Core RC2 project, you first have to install the .NET Core Preview 1 SDK. It is available at the official dot.net site and installs the dotnet CLI tool and registers it globally for all users on the PATH variable. In Jenkins, you'll need the following plugins:
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}']]])
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