Here at Trov, we're all fans of xUnit.net for testing C# apps and our new (super-secret) project is going to use Jenkins for Continuous Integration. We've had some issues in the past with TeamCity/Github integration and since our Android team is on Jenkins we thought we'd give it a shot.
Unfortunately there aren't any plugins for running xUnit.net tests in Jenkins nor is there any support for reporting the results via the xUnit plugin. We took some time yesterday to remedy both problems.
Running xUnit v2 tests
Since xUnit 2 has split the execution
xunit.executionfrom the runners
xunit.runners, add both NuGet packages to your project's
packages.config. We chose the test project, but it doesn't really matter.
The console runner
xunit.console.exerequires that the appropriate
xunit.execution.dllbe present in the same directory as the test DLL. Dave wrote a batch file to take care of this. Download it and add an
Execute Windows batch commandbuild task to your job which runs something like this:
Jenkins should now discover all projects named
*.Testsin the same directory as the
test.batfile and assumes that the output of the Test project will be in
At this point you should run your build and verify from the console output that xUnit is indeed running your tests.
When we have some more time, we'll look into making a proper Jenkins plugin but the batch file does the job for now :)
Reporting xUnit v2 results
Add a "Process xUnit test result report" build step after the "Execute Windows Batch command" step.
Choose "xUnit.Net-v2" from the dropdown.
Add the output file pattern
Hit "Save" at the bottom of the form and run a build.
If you come across any oddities in the output, please let us know. There's only one basic test right now and we look forward to adding more.
Update: They merged this on Dec. 22 so it should be available to everyone now.