DotCover TFS Extension

Dinesh P
2 min readMay 25, 2021

This article is about using the TFS Extension for DotCover which can be used in your build definition to run your tests.

DotCover Code Coverage Extension is an alternative to the power-shell script which is stored in the code repository, which is later used during the CI build to verify the unit/integration tests coverage in the project.

source code : https://github.com/samdinesh86/DotCoverTFSExtension

Build Agents — Prerequisites

1. Add the task from the available list

2. Build Step

Place the task right next to your present dot cover PowerShell script.

3. Build Step configuration

Fill the following mandatory fields with the necessary information to get the tests running

4. Advanced configuration

This section specifically created for an advanced configuration where you like to different settings than the default ones.

I have mentioned the default values which are inside the task, if you like to change any of the default paths please remove the “Default Value =” and fill in the desired configuration.

  • Excluded Assemblies — This is the assemblies which you don’t like to cover as part of the analysis, you can always specify all the assemblies that you like to test in the Test Assemblies in the above mandatory section.
  • Report Type — Report type by default is HTML, another option here is XML which produces DetailedXML which can be used in conjunction with ReportGenerator.
  • VSTest Path — This is the path where the vstest.console.exe is placed in the system, default value here is as per the VS2017 installation path in most of the build agents, if any custom needs to mentioned please use this space.
  • DotCover.exe Path — This represents the directory where the dotcover.exe is present, the default value, for now, is “C:\BuildTools\dotcover.2018.1”

Originally published at http://samdinesh.blogspot.com.

--

--