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

Unable to instrument module pdb without local source files #1297

Closed
madhugilla opened this issue Feb 10, 2022 · 3 comments
Closed

Unable to instrument module pdb without local source files #1297

madhugilla opened this issue Feb 10, 2022 · 3 comments
Labels
as-designed Expected behaviour duplicate This issue or pull request already exists

Comments

@madhugilla
Copy link

hi,

i am running into the following when trying to generate code coverage for a particular assembly Fulfillment.Function.dll, this assembly contains sourcegenerated files , from what i gathered so far, coverlet will not instrument assemblies with source generators that do not contain ".g.cs",

tried the following options without any luck

coverlet .\bin\Debug\net6.0\Fulfillment.UnitTests.dll --target "dotnet" --targetargs "test --no-build" --verbosity detailed --exclude="[FunctionEndpointTrigger]*"

coverlet .\bin\Debug\net6.0\Fulfillment.UnitTests.dll --target "dotnet" --targetargs "test --no-build" --verbosity detailed --exclude-by-file=\"**/XYZ_FunctionEndpointTrigger.cs/"

how do i overcome this ?

thanks -madhu

Unable to instrument module: .\bin\Debug\net6.0\Fulfillment.Function.dll, pdb without local source files, [D:\ft\src\Function.Fulfillment\XYZ.AzureFunctions.SourceGenerator\XYZ.AzureFunctions.SourceGenerator.TriggerFunctionGenerator2\XYZ__FunctionEndpointTrigger.cs

@petli
Copy link
Collaborator

petli commented Feb 10, 2022

There is currently no way around this, but #1164 suggests a new option to let the user control this heuristic. I haven't had any time to work on it, but it should be a fairly straight-forward contribution since it doesn't touch any of the instrumentation logic itself, just a check before it gets going.

@MarcoRossignoli
Copy link
Collaborator

Closing as dup and I've referenced this issue inside the other one

@definitelyokay
Copy link

I think I'm also having this issue when trying to collect code coverage on an executable which includes assemblies that have source generators. Getting no coverage at all and lots of "unable to instrument module ..., pdb without local source files." (On an Apple Silicon macOS 12.5.1 computer, if that matters).

It seems like #1392 will fix this — is that correct? If so, does anyone know when we might be able to expect a release?

(and thanks for the great tool everyone!)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
as-designed Expected behaviour duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

4 participants