Skip to end of metadata
Go to start of metadata
You are viewing documentation of TeamCity 6.5.x, which is not the most recent released version of TeamCity. Please refer to the listing to choose another version.
Search

Table of Contents


If you run tests using NUnit, MSTest, MSpec or .NET Process Runner runners or run NUnit tests via supported tasks of MSBuild or NAnt runners, you can turn on coverage collection in TeamCity web UI for the specific runner.

For other cases, when the .Net code coverage is collected by the build script and need to be reported inside TeamCity (for example, Rake runner, or if you run NUnit tests via test launcher other than TeamCity NUnit Test Launcher), there is a way to let TeamCity know about the coverage data.
Communication is done via service messages.
First, the build script need to let TeamCity know details on the coverage engine with "dotNetCoverage" message.
Then, the build script can issue one or several "importData" messages to import the actual code coverage data files collected.
As a result, TeamCity will display coverage statistics and HTML report for the coverage.

Configuring Code Coverage Engine

Use the following service message template:

where key is one of the following:
For DotCover:

key

description

dotcover_home

Full path to DotCover home folder if using custom dotCover.

For NCover 3.x:

key

description

sample value

ncover3_home

Full path to NCover installation folder.

Path to NCover3 installation directory

ncover3_reporter_args

Arguments for NCover report generator.

//or FullCoverageReport:Html:{teamcity.report.path}

For NCover 1.x:

key

description

sample value

ncover_explorer_tool

Path to NCoverExplorer.

Path to NCoverExplorer

ncover_explorer_tool_args

Additional arguments for NCover 1.x.

 

ncover_explorer_report_type

Value for /report: argument.

1

ncover_explorer_report_order

Value for /sort: argument.

1

For PartCover:

key

description

value

partcover_report_xslts

Write xslt transformation rules one per line (use |n as separator) in the following format: file.xslt=>generatedFileName.html.

file.xslt=>generatedFileName.html

Importing Coverage Data Files

To pass xml report generated by a coverage tool to TeamCity, in your build script use the following service message:

where tool name can be dotcover, partcover, ncover or ncover3.

Icon

For dotCover you should send paths to snapshot file that is generated by dotCover.exe cover command