dotnet / dotnet/efcore

Add the attribute ExcludeFromCodeCoverage for migrations

Open
#33,138 2 comments 10 reactions 0 assignees View on GitHub
area-migrations customer-reported needs-design
Dominant language
C#
Stars
14.8k
Forks
3.4k
PR merge metrics
PR metrics pending

Description

# Context

When pushing changes to git for an application I'm working on, some unit tests are executed and pushed to Sonarqube where I can get a unit test code coverage percentage.

However, if I do nothing, the EFCore migration are analyzed and lower the code coverage of the whole application where these actually don't need to be considered as part of the code.

# Solution

Currently, I'm modifying each migration file by adding the `ExcludeFromCodeCoverage` attribute on the top of the ".Designer" class but it would be nice that the file generated with the `Add-Migration` command includes this attribute.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.