dotCover
 
Get dotCover

Set up Coverage on JetBrains TeamCity

Last modified: 11 February 2024

Normally, a continuous integration (CI) build for a .NET solution consists of a series of tasks that involve compiling and running tests. In terms of JetBrains TeamCity CI server, these tasks are called build steps. As TeamCity comes bundled with dotCover command-line tool, you can collect code coverage data by just enabling the corresponding build step option. TeamCity-collected coverage results can be viewed as a report inside TeamCity or downloaded as a coverage snapshot and viewed inside Visual Studio.

For example, we have a simple solution that consists of two projects: one stands for the application and the other one for the test assembly. Our task is to set up continuous integration build that compiles the application, runs tests, and collects tests coverage statistics. Note that the workflow differs depending on the unit test runner you use: