Question

I am used to XUnit.net for all my unit testing needs in my C# projects. For my personal projects I was using TeamCity as my CI server and with the right plugin, the unit tests were correctly launched and results correctly reported in TeamCity.

However for work we have the constraint to use Jenkins as our CI server. I would like to know if Jenkins correctly supports XUnit.net (and also XUnit.net theories). I have seen a plugin XUnit for Jenkins which can support various XUnit frameworks, however I have not found any guide or discussion specifically related to XUnit.net framework support in Jenkins.

I would mainly like to know if I can start implementing unit tests based on XUnit.net (with theories as well), and rest assured that Jenkins will correctly report all runned tests (and correctly consider each theory as a distinct test) ... or if I will run into issues and should go with using NUnit instead.

Was it helpful?

Solution 2

The common ground between Jenkins and xUnit.net is that they both have support for NUnit's XML format.

Add a build step to your Jenkins configuration that calls the xunit console runner like so: xunit.console.exe tests.dll /nunit test_report.xml

Then add an NUnit plugin (or the generic xunit one) and point it to your nunit-format report file.

** disclaimer: Jenkins was still called Hudson last time I used it, and I've never used xUnit.net, so this may be inaccurate.

OTHER TIPS

This is kind of an old question, but I think it make sense to stress it as an answer here to save some time to anyone who will be interested in it in the future:

Starting from the version 1.93 xUnit+Plugin (universal unit testing plugin for Jenkins) do support xUnit.net v2 (unit testing framework for .NET):

xUnit.net support in xUnit plugin

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top