Running coverlet global tool in docker with already compiled binary does not find any coverage #1271
Labels
driver-console
Issue related to dotnet net tool driver
duplicate
This issue or pull request already exists
enhancement
General enhancement request
with repro
Issue with repro
I have a case where the coverlet global tool works fine when executed directly on my machine (windows 10) but that fails to report coverage when executed in docker against an already compiled dll.
Here's a procedure to reproduce the issue.
First clone the following repository that contains a very simple test project.
Compile the solution directly on your host machine (mine was a windows machine).
Make sure that invoking coverlet outside of docker works fine. Note that I explicitely pass the dll to the 'dotnet test' command. This will be required later under the docker.
Ok, so we know that coverlet works fine and that the line coverage is 66.66%. Let's now open a docker prompt where we will try to do about the same thing:
You should now be in a bash shell within docker. Let's first install coverlet. Note that I install version 1.7.2 because I am using .net core 3.1
And finally, let's run coverlet within docker:
As you can see, my tests are executed correctly but coverlet does not report any coverage.
Let's now try to recompile my project in docker and run coverlet again
We now see that coverlet now works fine. But unfortunately, I had to recompile my code in docker. For this small project, recompiling is not a big problem but in large projects, this can add significant delays to the CI.
So, do you have any idea on how I can make this coverage work under docker without recompiling my code?
The text was updated successfully, but these errors were encountered: