4
votes

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.

2
how do you exclude the namespace? try: +:assembly=*;type=*;method=*** - Maria Khalusova
That is how I do it yes. But the excluded type still show up in the report, but now as being 0% covered, which is undesirable. I just want it to be hid completely from the report when I exclude it. - Nikolaj Dam Larsen

2 Answers

1
votes

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

0
votes

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