TeamCity
 
You are viewing the documentation for an earlier version of TeamCity.

NCover

Last modified: 20 April 2023

TeamCity supports code coverage with NCover (1.x and 3.x) 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.

Configuring NCover 1.x



Make sure your NUnit tests run under x86.

To configure NCover 1.x:

  1. While creating/editing Build Configuration, go to the Build Steps page.

  2. Add one of the build steps that support NCover (.NET Process Runner, MSBuild, MSpec, MSTest, NAnt, NUnit), configure unit tests.

  3. Select NCover (1.x) in .NET coverage tool.

  4. Set up the NCover options - refer to the description of the available options below.

Configuring NCover 3.x



Make sure you use have specified the same platform both for NCover and NUnit.

To configure NCover 3.x:

  1. While creating/editing Build Configuration, go to the Build Steps page.

  2. Add one of the build steps that support NCover (.NET Process Runner, MSBuild, MSpec, MSTest, NAnt, NUnit), configure unit tests.

  3. Select NCover (3.x) in .NET coverage tool.

  4. Set up the NCover options - refer to the description of the available options below.

Reporting NCover Results Manually



If .NET code coverage is collected by the build script and needs to be reported inside TeamCity (for example, Rake, or if you run tests via a 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.