Attribute filter syntax for code coverage in TeamCity

好久不见. 提交于 2019-12-10 03:26:40

问题


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

回答1:


After trying out a few variations this worked:

-:System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute



回答2:


Make sure you add this filter inside Attribute Filter:

-:System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute



来源:https://stackoverflow.com/questions/12482815/attribute-filter-syntax-for-code-coverage-in-teamcity

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!