coverlet-coverage / coverlet

Cross platform code coverage for .NET
MIT License
2.98k stars 386 forks source link

Unable to instrument the project when moved #1353

Closed mklemarczyk closed 2 years ago

mklemarczyk commented 2 years ago

Hello,

Problem description

I have an issue using coverlet and xUnit to test and compute coverage on .NET Framework 4.8 project. (I use the coverlet console as entry point) The coverlet works properly when project is build and than tested.

The issue is about no coverage computed when the project is moved after the build. The context is for multi-agent setup in Azure DevOps, where the location of the source, binaries and tests are located based on agent name and build number.

Diagnostic

I found by debugging the source code that coverlet is not able to find the pdb files.

The locations that are searched is PDB embeded in dll module, and original build location. The build location mapping is not available to coverlet console. :(

Unfortunately there is not log message even with detailed mode to see that problem.

Possible solution

I will propose solution to this issue later today. It is to extend the search locations for pdb files, as those are usually located next to the dll module file for .NET Framework projects.

Context:

MarcoRossignoli commented 2 years ago

Yep coverlet needs PDB metadata to instrument and calculate the report. I'll review the PR thanks

mklemarczyk commented 2 years ago

Thank you for the integration :) @MarcoRossignoli, do you know when is planned next release? It was a while since last one in February.

MarcoRossignoli commented 2 years ago

There's no ETA yet, we don't have strict schedule, for now you can give it a try using the dogfood and let us now if it's working as expected https://github.com/coverlet-coverage/coverlet#Consume-nightly-build

mklemarczyk commented 2 years ago

Hello @MarcoRossignoli, sorry for the late response. We tested well the nightly release. It works now as expected. We wait the official release of coverlet with changes, to be able to integrate it the production pipeline.

MarcoRossignoli commented 2 years ago

We have some issue with pipeline as soon will be fixed we'll release.

I'm closing this one cause solved.