Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code coverage excludes .NET Framework VB projects using portable pdb files #1100

Open
mattwildgoose opened this issue Feb 26, 2021 · 1 comment
Assignees
Labels
bug Something isn't working tracking-external-issue The issue is caused by external problem - nothing we can do to fix it directly

Comments

@mattwildgoose
Copy link

I've been using coverlet for a while now on a large solution containing many .NET Framework 4.8 projects in both VB and C#. It was all working fine until recently we updated the projects to generate portable pdb files instead of the legacy windows format. Now the coverage data only includes C# projects despite tests being executed for the VB projects.

I've created a repository on github to demonstrate the issue
https://github.com/mattwildgoose/CovertletNet48PortablePdbIssue

I believe that the issue lies in InstrumentationHelper.PortablePdbHasLocalSource which iterates over the Documents inside the portable pdb meta data and if it cannot locate the relevant file then it will not instrument the module.

For VB projects compiled on .NET 4.8 it appears that the portable pdb contains a strange empty item (shown below using JetBrains dotPeek) which means the entire module is skipped

image

I don't know enough about the pdb generation to know whether this entry should be there or not (feels like it shouldn't). But is this something that you can account for in coverlet so I'm able to collect coverage data without going back to the legacy pdb format which is Windows only and significantly larger?

@MarcoRossignoli MarcoRossignoli added the untriaged To be investigated label Feb 28, 2021
@daveMueller
Copy link
Collaborator

I opened a ticket at the roslyn repo for this dotnet/roslyn#51611.

What I see is that this entry in the document table still has a language guid. So we could ignore entries that have a empty Name and a VB language guid?

Somewhere in this area:
https://github.com/coverlet-coverage/coverlet/blob/master/src/coverlet.core/Helpers/InstrumentationHelper.cs#L168-L182

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working tracking-external-issue The issue is caused by external problem - nothing we can do to fix it directly
Projects
None yet
Development

No branches or pull requests

3 participants