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.

Missing coverage in 1.7.0

See original GitHub issue

In a .net core project running using coverlet.console 1.6.0 we get these results.

+--------------------------------------+--------+--------+--------+
| Module                               | Line   | Branch | Method |
+--------------------------------------+--------+--------+--------+
| namespace            | 97.53% | 99.34% | 100%   |
+--------------------------------------+--------+--------+--------+
| namespace.ViewModels | 100%   | 100%   | 100%   |
+--------------------------------------+--------+--------+--------+

But when running in 1.7.0 (and 1.7.1) we get

+--------------------------------------+--------+--------+--------+
| Module                               | Line   | Branch | Method |
+--------------------------------------+--------+--------+--------+
| namespace            | 99.11% | 75.75% | 95.53% |
+--------------------------------------+--------+--------+--------+
| namespace.ViewModels | 87.23% | 100%   | 87.23% |
+--------------------------------------+--------+--------+--------+

Running on windows with this command coverlet .\tests\UnitTests\bin\Debug\netcoreapp3.1\namespace.UnitTests.dll --target "dotnet" --targetargs "test .\tests\UnitTests --no-build" --format opencover --output "c:\dev\coverage\namespace\" --exclude '[coverlet.*]*' --exclude '[NUnit3.*]*' --exclude '[Refit]*' --exclude '[StackExchange.*]*' --exclude '[Refit.*]*' --exclude '[System.*]*' --exclude '[Pipelines.*]*' --include '[*]*'

When we run Report generator against the opencover report, it shows whole methods as if they were set to ignore coverage, rather than being uncovered. The tests cover those methods (though not completely).

I don’t yet have a sample app I can reproduce the results with.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:9

github_iconTop GitHub Comments

2reactions
MarcoRossignolicommented, Jun 9, 2020

<ExcludeByAttribute>Obsolete,GeneratedCodeAttribute,CompilerGeneratedAttribute</ExcludeByAttribute>

You cannot use GeneratedCodeAttribute because for every async method roslyn compile a state maching with attribute [GeneratedCodeAttribute] there was a bug in filtering in past and this wasn’t honored, now we fixed that.

dup of https://github.com/coverlet-coverage/coverlet/issues/794#issuecomment-612067552

0reactions
MarcoRossignolicommented, Jul 11, 2020

Closed for stale conversation, feel free to re-open if needed.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Missing Unit Test Coverage but have Unit Test Statistics
I have seen “Project coverage is set to 0%” – JaCoCo and Sonar in Jenkins, and tried the suggestions there to no avail....
Read more >
No Coverage Map 1.7.0 Build 20200703
There is no coverage map and the devices do not remain on the map when locked. ... However the heatmap still is a...
Read more >
pytest-cov 1.7.0
This plugin produces coverage reports. It supports centralised testing and distributed testing in both load and each modes. It also supports coverage of ......
Read more >
Sonar is showing 0% code coverage with QUnit/JavaScript but ...
What I am trying to achieve is getting COVERAGE to be greater than ZERO while there are 373 lines of code that show...
Read more >
Code coverage report seems incorrect. Why?
The test code is: We can see that the method getUser has been tested and the getRecord.append statements have been covered.
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