dotnet / dotnet/samples

Code coverage reconfiguring: Visual studio versus coverlet

Open
#4,929 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
3.7k
Forks
5.1k
Avg merge
9h 11m
Merged PRs (30d)
1

Description

According to following article:

https://docs.microsoft.com/en-us/dotnet/core/testing/unit-testing-code-coverage?tabs=windows
https://github.com/dotnet/samples/tree/main/csharp/unit-testing-code-coverage

It's proposed to use coverlet for C# code coverage testing.

This is good, but configuring code coverage for Visual studio versus coverlet differs,

According to coverlet github - code coverage configuration can be specified in two ways:

(See also `https://github.com/coverlet-coverage/coverlet/issues/1269`)

1. `dotnet test /property:CollectCoverage=True`...
2. `dotnet test --collect "XPlat Code Coverage"`...

But both approach do not use .runsettings file configured by Visual studio.

Is there any future directions concerning code coverage , like ?

1. Add support into Visual studio of parsing coverlet configuration out of box, Add support of using coverlet data collector for Visual studio IDE ?
2. Add support into coverlet of parsing Visual Studio's .runsettings file.
3. Add support into Visual studio code coverage of producing other file format than .coverage, like opencover file format.

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.