Different output format results in different coverage percentage
See original GitHub issueI would have assumed that the code coverage output format ist just that - a file format. But it seems like using a different output format also affects code coverage percentage. Is this by design?
Example:
I use a .NET regular expression source generator in my code.
When I use dotnet test
with the argument --collect:"XPlat Code Coverage;Format=cobertura"
then it does count the generated code in the namespace System.Text.RegularExpressions.Generated
.
When I use dotnet test
with the argument --collect:"XPlat Code Coverage;Format=opencover"
then it does not count the generated code.
Package: coverlet.collector 6.0.0 .NET 7
Issue Analytics
- State:
- Created a month ago
- Comments:8
Top Results From Across the Web
Code coverage testing - Visual Studio (Windows)
Learn how to use the code coverage feature of Visual Studio to determine what proportion of your project code is being tested by...
Read more >Tutorial - Measuring code coverage
The coverage percentage for a source file is calculated as 100 * (NE + NFE) / (NS + NF) , where NS is...
Read more >How can I use pytest-cov to both generate a coverage ...
Run pytest under coverage, either with pytest-cov, or with coverage run -m pytest . Then generate coverage reports from the results. – Ned ......
Read more >coverlet/Documentation/MSBuildIntegration.md at master
Coverlet can generate coverage results in multiple formats, which is specified using the CoverletOutputFormat property. For example, the following command ...
Read more >Test coverage overview - SonarQube Docs
Test coverage reports tell you what percentage of your code is covered by your test cases. Test execution reports tell you which tests...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@danielpalme You can find the Cobertura (and OpenCover) file here: https://github.com/coverlet-coverage/coverlet/issues/1519#issuecomment-1676447115
Thanks for the analysis. I’ll test this again in a few days.