How to generate multiple NCover 3 reports?

I have a build step running NUnit tests using the TeamCity testrunner, with the additional option of coverage running NCover 3. The NCover.Reporting argument is set as follows:

//or FullCoverageReport:Html:{}

Q1: When I switch to the Code Coverage tab, I get a message about how there is no index.html, and it just lists all the html files. I expect this is because NCover calls it's entry point "fullcoveragereport.html" or similar. Regardless, it looks kak, so I managed to figure out by editing the TeamCity .BuildServer\config\main-config.xml and changed my report tab to this:

  <report-tab title="Code Coverage Summary" basePath="" startPage="fullcoveragereport.html" />

Is that what you would expect to have to do?

Q2: Secondly, I want to produce a second report from the same build step, that I can put on another tab. I believe NCover Reporting supports multiple //or arguments, so I wondered if I could piggy back a second line onto the above //or setting.

However I don't really know what I am doing, and I don't understand the "magic" behind "{}" and what/if I need to change that to for a second //or argument.

Can someone please help? Using TC 6.5.2.

1 comment
Comment actions Permalink

Ok, I did this (below) and it seems to work in the way that I want - again confirmation that this is the "right" thing to be doing would be great. My TeamCity config now has these two lines instead of what I posted previously

  <report-tab title="Coverage Summary" basePath="" startPage="FlatCoverageSummary.html"/>
  <report-tab title="Coverage Detail" basePath="" startPage="fullcoveragereport.html" />

And my configuration for the reporting build step now has two lines in it like this:

//or FullCoverageReport:Html:{}
//or SymbolModuleNamespaceClass:Html:{}\FlatCoverageSummary.html

This writes the flattened summary report into the same root directory of as the rest of the full report, but does not seem to do any harm in this case.

So assuming I haven't committed any cardinal sins above, my third question then is: doing this changes the configuration for all projects on the build server. I can create report tabs at the project level using the TeamCity UI, but if I want the tab to appear at the build detail level then it appears editing this config file is the way to go. That presumably puts limitations across all of the projects you host on that TeamCity instance. Am I correct in all these assumptions, or is there another suggested way to do this?

For instance if another team did not like my tab names at the project level, or only wanted a single tab etc would they have any options around this? Under what conditions will the tabs not appear for them - e.g. if they have no code coverage target is it hidden?


Please sign in to leave a comment.