NCover Nant Team City Integration
I’ve been spending quite a bit of time setting up NCover and then integrating it into Team City.
I’ve read some posts which cover parts of this process but nothing which covers the end to end process so hopefully my experience can help to fill that void.
Step 1Download NCover 1.5.8, NCover Explorer 188.8.131.52, NCover Explorer Extras 184.108.40.206 from Kiwidude's website and the NCover website .
Step 2Put the following into your Nant build file: ~~~text
The next step is to setup the artifacts for your project. From the Team City admin panel navigate to the project configuration settings and select artifacts.
Add the following to the ‘Artifact paths’:
It should now show up as a viewable artifact from the project listing page.
To get the coverage report to show up on a tab on the build summary page we need to edit the main-config.xml file
The location of this file can be found by browsing to ‘Administration > Server Configuration’ from the Team City admin panel
Add the following line after the other ‘report-tab’ entries in this file:
<report-tab title="Code Coverage Summary" basePath="" startPage="TestCoverage.html" />
I encountered some problems in getting this up and running. They were as follows:
NCover: Profiled process terminated. Profiler connection not established
After some Googling I found this post which explains how to solve the problem.
To summarise this problem occurs when trying to run NCover without Administrative privileges. The coverlib.dll shipped with NCover needs to be registered. This can be done two ways:
1) Put the following code into your build file right at the top
<exec program="regsvr32" workingdir="\path\to\ncover" commandline="/s coverlib.dll"/>
2) Run the same command from the command line
NCover - Requested value '/r' was not found
This error occurred when I was using version 1.0.1 of NCover and to cut a long story short, you need to upgrade to get rid of the problem.
More details are on this post.
The information here has been accumulated from my experiences, this post on NCover integration and the official documentation.