4

I'm using Teamcity with NUnit and dotCover. In my configuration I exclude a specific namespace and its contained classes from dotCover coverage. This part is working fine, but when running the build, the resulting report still show the excluded assembly in the report though, with the excluded assembly as being 0% covered. This 0% coverage is also reflected in the aggregated coverage percentage, so the overall picture from the report is not showing correct statistics.

How to I get the excluded assemblies (or classes in this case) to not show up in the coverage report?

Edit: I want to make clear, that I am not looking for a way to exclude code from dotCover, as I am already aware how to do this. I am looking for at way to have the excluded code, removed, or not show up, in the report created for Teamcity.

Nikolaj Dam Larsen
  • 5,455
  • 4
  • 32
  • 45

2 Answers2

1

I removed my test project from being created in dotCover report by adding following lines to "Filters:"
-:*.Tests.dll
-:Utilities.Tests

and to Attribute Filters
-:module=Utilities.Tests

Now i get report without Test project/code

Regards, Dejan

Dejan Dakić
  • 2,418
  • 2
  • 25
  • 39
0

If you want to exclude for example TestAsseblies this is the filter you have to use:

-:*Tests

This would exclude "HelloWorld.Tests.dll" but include "HelloWorld.dll".

More and complete help can be found at http://confluence.jetbrains.net/display/TCD65/JetBrains+dotCover

SeriousM
  • 3,374
  • 28
  • 33
  • I'm excluding a specific namespace within an assembly, and it is being succesfully excluded. My problem is not how to exclude code from dotCover, but how to "hide" the excluded code from the report displayed in Team City. When building a report in TC, the excluded namespace is still shown, but as 0% covered, and is also included in overall coverage percentages. In the desktop version of dotCover, you can right-click the namespace in the report and select "hide" - my question is how this is done similar in Team City. – Nikolaj Dam Larsen Dec 07 '11 at 14:20
  • this is just a guess: look into the config of the desktop version of dotCover and into the config of your TC project (the xml). maybe you find some options you can insert there. otherwise call the dotCover console directly on the agent as command script task. here is some help: http://blogs.jetbrains.com/dotnet/2010/07/running-code-coverage-from-the-console-with-dotcover/ – SeriousM Dec 12 '11 at 11:39