There’s no clear, concise documentation on how to get NUnit working with CruiseControl.NET. So I figured I should write it, having gone through the pain of trying to figure everything out.
I assume you already:
- Have a solution that builds in CC.NET
- Have a project that builds the NUnit tests DLL
The recommended way of integration is not the
nunit tag, but it’s via the
exec tag. This supposedly will break less than using the
Here’s what you need to do:
Run NUnit in CruiseControl.NET
Add the following into your ccnet.config under
tasks for your project:
After executing the main build (MSbuild or whatever it is), this will invoke
nunit-console and tell it to run the
your.nunit.dll assembly’s tests, and to write the output to
The next step is to tell CruiseControl.NET to read this file and include it in the dashboard information. To do this, we need to add a publisher. As a point of extensibility, CruiseControl.NET allows you to merge any XML files into the build report; some, like NUnit, which it understands, it will display meaningfully.
To add a publisher, add the following after your
This tells CruiseControl.NET to merge the
C:\blah\blah\nunit-results.xml content into the main build XML.
And that should be it! Force a build, and you should see CC.NET reporting success/failure test statistics in the web dashboard.