The first build was successful, but it didn’t run the unit tests. The build log contained the following warning:
No test found. Make sure that installed test discoverers & executors, platform & framework version settings are appropriate and try again.Of course, I was missing the NUnit test adapter on the build server. The article on how to Run tests in your build documents how to resolve this in the Q/A section — but that solution involves checking in binaries and tweaking your build definition. I’m not a big fan of that approach and fortunately there’s another way to solve this.
It turns out that there’s a NUnit Test Adapter for VS2012 and VS2013 NuGet package. You only need to install this in one of the projects in your solution for the build server to find the assemblies. I added it to one of the unit test projects and voilà! On the next build, the tests ran as expected. For the record: they were all green too.
There are a few reasons for why I prefer this approach:
- You avoid checking in binaries
- There's less custom configuration for your build definition
- You can easily keep track of updates to the test adapter through NuGet
So there. With the CI build up and running, I can now get back to planning the next NWebsec release.