In my previous post on JetBrains TeamCity I mentioned that it has no support for .NET code coverage. With this post I want to correct the injustice of this statement. It was a simple case of RTFM that solved this issue. Actually this great post pushed me into the right direction (you can even download some specific TeamCity MsBuild tasks).
One might think you have to jump through quite some hoops in order to integrate code coverage, but it is actually really easy. Here goes:
1. Make sure that your build script creates a code coverage report. I'm using NCover/NCoverExplorer for this with the corresponding MsBuild tasks that you can download here (in the NCoverExplorer Extras package).
3. Add the following line to the TeamCity Data Directory/config/ main-config.xml file as described here:
<report-tab title="CodeCoverage" basePath="" startPage="CodeCoverage.html"/>
4. You're done.
Now behold the results:
It creates a new tab for the build results that integrates the code coverage artifact. The coolness of TeamCity just keeps amazing me.