Tuesday, December 2, 2014

xUnit.net, JUnit & Jenkins

How to publish xUnit.net 2.0 results in Jenkins.

Files in attached zip file to put in the root folder of the Jenkins workspace are runxunit.bat and xUnit2ToJUnit.xslt.
xunit.net_jenkins_v1.zip
  1. Add Jenkins xUnit Plugin
  2. Add NuGet packages.
  3. Add Build command for running tests.
  4. Add Post-build Action for publishing test result. 



1. Add Jenkins xUnit Plugin

Add the xUnit Plugin to your Jenkins server.



2. Add NuGet packages.

Add the following nuget packages.
xunit
xunit.abstractions
xunit.assert
xunit.core
xunit.runners



3. Add Build command for running tests.

Add a build command as in this image, after the project build command.
Exchange PATH_TO_DLL_WITH_TESTS with the actual path to the dll with tests.




4. Add Post-build Action for publishing test result.

Add a post build action like in this image.

No comments:

Post a Comment