question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Code coverage returns NAN%

See original GitHub issue

I 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:closed
  • Created 3 years ago
  • Comments:10 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
wdolekcommented, Sep 9, 2020

@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! 🙇

1reaction
MarcoRossignolicommented, Sep 9, 2020

I’ll add to known issue!

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found