Missing coverage in 1.7.0
See original GitHub issueIn 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:
- Created 3 years ago
- Comments:9
Top GitHub Comments
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
Closed for stale conversation, feel free to re-open if needed.