coverlet-coverage / coverlet

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

Question: Active logging or suggestions how to investigate a strange functionality #1653

Open Tbd19 opened 7 months ago

Tbd19 commented 7 months ago

I have a Web Api with multiple endpoints that are being tested with Integration tests. Now we want to generate report for code coverage but for some reason they are 0% coverage. And I got to this point: When I filter for a single endpoint the code coverage is NOT 0% and it works as expected When I filter for 2 or more endpoints the code coverage becomes 0%. The command is similar just the filtering is different

How can I determine what makes the code coverage be 0% when doing filter for each it is not 0%

PS: None of the tests are failing.

Bertk commented 4 months ago

Hi, you can use the diagnostic logging. You find the relevant information here: https://github.com/coverlet-coverage/coverlet/blob/master/Documentation/Troubleshooting.md#collectors-integration

e.g --Diag:"log.txt;tracelevel=verbose"