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.

Coverage report missing one of the projects

See original GitHub issue

Hello 👋🏻

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:closed
  • Created 2 years ago
  • Comments:6

github_iconTop GitHub Comments

1reaction
daveMuellercommented, Mar 27, 2021

OK thanks I’ll look into this again. Maybe coverlet really has an issue detecting embedded .pdb in some edge cases.

1reaction
daveMuellercommented, Mar 26, 2021

So I just took a look into this. Seems that Fody is somehow changing the embedded pdb. With Fody we can’t read the debug data. System.Reflection.PortableExecutable.PEReader can’t read the path of the pdb.

image

Without Fody it isn’t a problem at all.

image

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Code Coverage Results are incomplete
But even then the code coverage results had some gaps (missing coverage from one project, significant drop in coverage for another project).
Read more >
Why are most of my project's Django files missing from ...
The answer seems quite trivial and obvious, but amazingly, it was quite difficult to come by. coverage will only report on code that...
Read more >
[Coverage missing]On Sonarqube Coverage is not showing ...
Q: I have the following configuration in Multi-module AEM project. I am facing an issue with the code coverage report on SonarQube.
Read more >
Coverage.py — Coverage.py 7.3.0 documentation
Coverage.py is a tool for measuring code coverage of Python programs. It monitors your program, ... coverage report -m Name Stmts Miss Cover...
Read more >
Read the coverage report - IntelliJ IDEA
Explore the code coverage in your projects by using IntelliJ IDEA. ... run a configuration with coverage and displays the coverage report.
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