Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Attribute filter syntax for code coverage in TeamCity

Anyone knows the syntax for excluding code from coverage in Teamcity? I am using the ExcludeFromCodeCoverageAttribute on certain methods and want those excluded. It works well in Visual Studio but I don't understand how to get the same behavior in TeamCity. The Field I am trying to configure is located in MsTest -> .Net Coverage -> Attribute Filters: I have tried this:

-:ExcludeFromCodeCoverageAttribute 

and this

-:ExcludeFromCodeCoverage
like image 239
Konstantin Avatar asked Sep 18 '12 18:09

Konstantin


2 Answers

After trying out a few variations this worked:

-:System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute
like image 97
Konstantin Avatar answered Sep 24 '22 01:09

Konstantin


Make sure you add this filter inside Attribute Filter:

-:System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute

enter image description here

like image 40
alansiqueira27 Avatar answered Sep 24 '22 01:09

alansiqueira27