.netopencoverappveyorcoveralls

Exclude classes from code coverage in coveralls



Currently I learn Appveyor and i use coveralls for .Net code coverage of mine source code. When i looked on the report i saw that i have a couple of classes (mostly models) which i cannot cover with unit test. I found one attribute [ExcludeFromCodeCoverage] which is not working with Coveralls integration. I found in the documentation that i can include in -filter ddls which i want to be covert, but it's will be paint full, because in reality the classes for excluding are less.

Is it possible somehow to exclude specific classes from code coverage ?

appveyor.yml
after_test: - packages\OpenCover.4.6.519\tools\OpenCover.Console.exe -register:user -filter:"+[**]*" -target:"packages\NUnit.ConsoleRunner.3.6.1\tools\nunit3-console.exe" -targetargs:"/domain:single test\PATH-TO-UNIT-TEST-DLL" -output:coverage.xml

Regards


Solution

  • You need to read the section on Understanding Filters

    e.g. -filter:"+[*]* -[MyModule]MyNamespace.MyClass"