How to make a TFS assembly not measure third-party assembly coverage

How can I make my CI assembly stop measuring the coverage of code (assemblies) that we did not write in our projects in the solution?

We have included code protection for our CI assembly solution in the definition of a TFS assembly. When we run code coverage locally in Visual Studio, we correctly get coverage information for only assemblies in the solution. However, when we register and the CI assembly starts covering code coverage reports in other third-party assemblies referred to by projects (both locally and on the CI assembly).

This significantly distorts the% code coverage measured in the CI assembly, as third-party assemblies have much more code blocks than our solution. Assemblies are not .net framework assemblies, but other assemblies are pulled from NuGet packages.

+4
source share
1 answer

if you use the startup settings file, you can exclude certain files from the code coverage.

file internals will look like this:

<ModulePaths>
   <Include>
     <ModulePath>.*\.dll$</ModulePath>
    </Include>
    <Exclude>
       <ModulePath>.*CPPUnitTestFramework.*</ModulePath>
       <ModulePath>.*test.*</ModulePath>
       <ModulePath>.*tests.*</ModulePath>
    </Exclude>
 </ModulePaths>

The above settings will exclude the entire test DLL from the coverage, you can simply add a fragment of the dll name to the exclude node to ignore the DLL from the code coverage.

therefore Some3rdParty.dll will be excluded with

<ModulePath>.*Some3rdParty.*</ModulePath>

http://msdn.microsoft.com/en-gb/library/jj635153.aspx

http://blogs.msdn.com/b/sudhakan/archive/2012/05/11/customizing-code-coverage-in-visual-studio-11.aspx

+4

All Articles