PartCover
TeamCity supports code coverage with PartCover (2.2 and 2.3) for NUnit tests run via TeamCity NUnit test runner, which can be configured in one of the following ways: web UI, TeamCity NUnit Test Launcher, NUnit for MSBuild, NUnit for MSBuild, NUnit for NAnt Build Runner.
To configure PartCover:
While creating/editing Build Configuration, go to the Build Runner page.
Select PartCover (2.2 or 2.3) as a .NET coverage tool.
Set up the PartCover options - find the description of the available options below.
Option | Description |
|---|---|
Path to PartCover | Specify the path to PartCover installed on a build agent, or corresponding Configuring Build Parameters, if configured. |
Additional PartCover Arguments | Specify additional PartCover arguments, except the ones that can be specified using web UI. Moreover, do not specify here the output path for the generated reports, because TeamCity configures it automatically. |
Include Assemblies | Explisitly specify the assemblies to profile, or use |
Exclude Assemblies | Explicitly specify the assemblies to be excluded from coverage statistics. If you have specified |
Report XSLT | Write xslt transformation rules in the following format (one per line): |
Reporting PartCover Results Manually
if .NET code coverage is collected by the build script and need to be reported inside TeamCity (for example, Rake, or if you run tests via test launcher other than TeamCity NUnit Test Launcher), there is a way to let TeamCity know about the coverage data. Please read more at Manually Configuring Reporting Coverage.