Skip to content

How to ExcludeFromCodeCoverageAttribute in a test framework scenario? #12

Description

Description

If I run dotnet test --collect="Code Coverage", then it counts xunit classes towards code coverage statistics.

Coverlet addresses this problem by providing an ExcludeByAttribute where the user can define arbitrary attributes to use for exclusion purposes.

Steps to reproduce

  1. Create a new .NET library project that has a class Foo that calculates A + B
  2. Create a new xunit test project that tests class Foo
  3. Run dotnet test --collect="Code Coverage"

Expected behavior

xunit assemblies not included in code coverage report.

Actual behavior

xunit assemblies included in code coverage report.

Diagnostic logs

n/a - please specify what you would want for this, and I can provide

Environment

Test SDK 17.5

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions