TeamCity + dotCover, filter on class/function?
Using Team City 6.0 with integrated dotcover runner.
In the Visual Studio dotCover plugin I have the ability to express filters not only for assemblies (modules), but also classes and functions.
For instance, in VIsual Studio I have filters to exclude NUnit Tests (by classname) from coverage reporting, some tests have code that never will be code but must be there to compile but this shouldn't count to lower the coverage percent.
The help for Team City dotCover settings says:
"Specify assemblies filters for code coverage. On every line use +:myassembly or -:myassembly to include or exclude assembly from code coverage. Use asterisk (*) as wildcard if needed."
Is there some reason why the Team CIty can't use the same module-class-function filter semantics (or is there a separate undocumented syntax for these)?
Regards,
Kim
Please sign in to leave a comment.
try:
+:assembly=*;type=*;method=***
Thanks, seems to work as expected!
I must be thick, but I can't get it to work:
I can remove assemblies easily like this:
-:my.assembly
-:*.test
but when I try to remove specific types it doesn't work, I tried:
-:assembly=*;type=my.namespace.*service;method=***
and
-:assembly=my.assembly;type=my.namespace.classname;method=***
I also tried omitting ';method=***' but no result
Try method=*
If that does not work, please attach build agent logs
tried method=*, but it still doesn't work, see agent log below:
Sorry for delay. I need more detailed debug information to figure out what went wrong.
Please open <agent>/plugins/dotNetPlugin/bin/teamcity-log4net.xml and replace it with <agent>/plugins/dotNetPlugin/bin/teamcity-log4net-debug.xml
Run the build
Attach produced build log.
See log file attached.
Attachment(s):
Build_dev_7.0.4.82.log.zip
What are the rules you specified. What is wrong in the build report you receive?
What I want to achieve is to exclude specific classes from the coverage report, more specifically when adding a service reference in VS a proxy class is created with potentially over a thousand lines of autogenerated code. Having this included in the coverage report makes it almost irrelevant.
In order to exclude this class I tried the filter combinations mentioned in previous posts.
Hi Alex.
Here is a similar thread with the same issue. http://devnet.jetbrains.net/thread/292759
We asked dotCover developers for help, and I'll let you know on any news.
Thanks
Michael