Code coverage returns NAN%
See original GitHub issueI have seen some reports of this here, but they doesn’t have any solutions due to inactivity, so I’ll try again.
I have a test project using coverlet, but whenever I try to run either dotnet test /p:CollectCoverage=true
or the coverlet
command I get the following result and an empty coverlet file.
Test Run Successful.
Total tests: 47
Passed: 47
Total time: 1,3797 Seconds
Calculating coverage result...
Generating report 'XXXX'
+--------+------+--------+--------+
| Module | Line | Branch | Method |
+--------+------+--------+--------+
+---------+------+--------+--------+
| | Line | Branch | Method |
+---------+------+--------+--------+
| Total | 100% | 100% | 100% |
+---------+------+--------+--------+
| Average | NaN% | NaN% | NaN% |
+---------+------+--------+--------+
I have referenced both coverlet.collector and coverlet.msbuild packages in my project…
Any ideas why or suggestions how to find more information about the issue?
Issue Analytics
- State:
- Created 3 years ago
- Comments:10 (2 by maintainers)
Top Results From Across the Web
Coverage returning %NaN% when running unit tests in ...
I have a dot net core version: '3.0.100', building on 'ubuntu-latest' and am trying to get code coverage reports.
Read more >5 Minute DevOps: The Value of Code Coverage - Bryan Finster
If they are not, then it returns NaN. Since alpha characters are also not divisible by 1, those will be trapped too. Naturally,...
Read more >Does Apex class test coverage of NaN% effect my overall ...
No, it does not. Apex test coverage is calculated as the percentage of lines covered out of total executable lines.
Read more >The Myth of 100% of Code Coverage | by David Rodenas, Ph. D.
Some people say that 100% of code coverage is an impossible goal, that it is too expensive. ... Moreover, Why it returns a...
Read more >Code Coverage
A measure of the amount of code that is executed by test code. What is the intended behavior? Inform the team of risky...
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
@MarcoRossignoli Just spent whole day trying to figure out why Coverlet works locally and not when running on GitLab Actions. I guess this is great candidate for another “Known issue” - it didn’t really strike me I should look into “Deterministic build”, I was iterating over other pages, tried adding/removing arguments, even lost my confidence in putting together shell commands.
Anyway, @dozer75 thanks for pointing this out! 🙇
I’ll add to known issue!