Manually Configuring Reporting Coverage
If you use MSBuild, NAnt or Visual Studio (sln) runner and run your NUnit tests by means of NUnit Support, you can easily configure reporting code coverage right from the web UI. For the details refer to NCover and PartCover pages.
Moreover, you can alternatively configure .NET coverage processing by means of service messages. This can be helpful, if you use a runner different from the listed above, for example, Rake, or if you run NUnit tests via test launcher other than TeamCity NUnit Test Launcher. To configure coverage reporting in your build script:
Use the following service message template:
##teamcity[dotNetCoverage <key>='<value>']wherekeyis one of the following: For DotCover:key
description
dotcover_homeFull path to DotCover home folder if using custom dotCover.
For NCover 3.x:
key
description
sample value
ncover3_homeFull path to NCover installation folder.
Path to NCover3 installation directory
ncover3_reporter_argsArguments for NCover report generator.
//or FullCoverageReport:Html:{teamcity.report.path}
For NCover 1.x:
key
description
sample value
ncover_explorer_toolPath to NCoverExplorer.
Path to NCoverExplorer
ncover_explorer_tool_argsAdditional arguments for NCover 1.x.
ncover_explorer_report_typeValue for
/report:argument.1
ncover_explorer_report_orderValue for
/sort:argument.1
For PartCover:
key
description
value
partcover_report_xsltsWrite xslt transformation rules one per line (use |n as separator) in the following format:
file.xslt=>generatedFileName.html.file.xslt=>generatedFileName.html
To pass xml report generated by a coverage tool to TeamCity, in your build script use the following service message:
##teamcity[importData type='dotNetCoverage' tool='<tool name>' path='<path to the results file>']wheretool namecan be dotcover, partcover, ncover or ncover3.