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.

Test coverage average coming as infinity

See original GitHub issue

We use coverlet with all our .NET Core projects(APIs, Libraries) and it works just fine for us.

Recently we have created one .NET Standard library and I have added .NET Core 2.2 xUnit test project in it with 2 tests. We have added coverlet.msbuild 2.5.1 nuget package to calculate the code coverage -

dotnet test -c Release --logger TRX /p:CollectCoverage=true /p:CoverletOutputFormat=opencover /p:CoverletOutput=TestResults

It runs the tests, all tests are passing but the code coverage is showing as empty with average “infinity”. It is not even identifying module name. Please refer attached notepad file for sample output.

What’s going wrong here? Sample output.txt

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:22

github_iconTop GitHub Comments

2reactions
Blaatschaapcommented, Sep 4, 2019

wow, okay. That fixed it. Can’t believe it is caused by using a project too simple though. Thanks a ton, I was stuck on this for the past hours. The INF% is probably caused by dividing by 0 then

0reactions
MarcoRossignolicommented, Oct 3, 2019

Close because solved…feel free to re-open if needed

Read more comments on GitHub >

github_iconTop Results From Across the Web

Test coverage average coming as infinity · Issue #516
It runs the tests, all tests are passing but the code coverage is showing as empty with average "infinity". It is not even...
Read more >
Code coverage for a project with infinite loops : r/rust
The typical way to get code coverage statistics is to have a unit or integration test suite that is run by the coverage...
Read more >
How can 100% test coverage be "not enough to prove ...
100% coverage is not 100% path coverage - Most applications have an infinite or near-infinite number of paths through the application. It's not ......
Read more >
c# - Code coverage in Testing
This thing keeps me wondering like how this code coverage works i mean they covers code on which bases? please tell the main...
Read more >
Code Coverage: What is the goal?
In light of recent research serious doubt has been cast on the usefulness of numerical targets such as 80% test coverage.
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