Coverage report missing one of the projects
See original GitHub issueHello 👋🏻
I thoroughly scanned open issues but couldn’t find an answer to my problem. It feels like I’m missing something obvious but can’t figure out what. 😩
I have the following project structure:
MiniRazor.Compiler.Tests
| references
+--------------> MiniRazor.Compiler
| references
+---------------> MiniRazor.Runtime
When running dotnet test
, I get the following report:
Passed! - Failed: 0, Passed: 13, Skipped: 0, Total: 13, Duration: 7 s - MiniRazor.Compiler.Tests.dll (net5.0)
Calculating coverage result...
Generating report 'MiniRazor\MiniRazor.Compiler.Tests\coverage.net5.0.opencover.xml'
+-------------------+--------+--------+--------+
| Module | Line | Branch | Method |
+-------------------+--------+--------+--------+
| MiniRazor.Runtime | 89,47% | 66,66% | 92,85% |
+-------------------+--------+--------+--------+
+---------+--------+--------+--------+
| | Line | Branch | Method |
+---------+--------+--------+--------+
| Total | 89,47% | 66,66% | 92,85% |
+---------+--------+--------+--------+
| Average | 89,47% | 66,66% | 92,85% |
+---------+--------+--------+--------+
As you can see, for some reason, it only shows coverage for MiniRazor.Runtime
, but not MiniRazor.Compiler
. The projects are not special in any particular way.
Also, I was able to get Coverlet working perfectly well on numerous other projects, this is the only one that’s giving me issues.
For reproduction purposes, here’s the project: https://github.com/Tyrrrz/MiniRazor/tree/cc2c70bbbaf9ef43098fea40bb19993c6e454fd4 (note the commit hash, I’ve since made a workaround that fixes coverage, see next comment)
Just clone it and run dotnet test
.
Here’s the latest build log from CI: https://github.com/Tyrrrz/MiniRazor/runs/2170799134?check_suite_focus=true
Any help is greatly appreciated 🙏🏻
Issue Analytics
- State:
- Created 2 years ago
- Comments:6
Top GitHub Comments
OK thanks I’ll look into this again. Maybe coverlet really has an issue detecting embedded .pdb in some edge cases.
So I just took a look into this. Seems that
Fody
is somehow changing the embedded pdb. WithFody
we can’t read the debug data.System.Reflection.PortableExecutable.PEReader
can’t read the path of the pdb.Without
Fody
it isn’t a problem at all.I played around with it a bit and it seems that changing debug type to full
<DebugType>full</DebugType>
helped if this is an option.