What does this mean "There is no actual code coverage for tests"

 

When looking at the code coverage i am seeing the following message , Does this mean that tests don't actually test anything ? I am trying to understand this , this is from inherited code and i am trying to figure out what this means ?  Has anyone see this before and know what this is ?

1
7 comments

I have a similar issue. No matter what I do the Unit Test Coverage window always says I have 0% code coverage.

And it always says "Coverage info for some tests is absent or outdated."

1
Avatar
Permanently deleted user

   I have the same issue. The weird thing is that everything worked 2 days ago but then suddenly it stopped. I was adding new tests which were supposed to cover new methods but the coverage percentage did change. Probably the last thing I did, I added Microsoft Shims to a test project. Then I dropped coverage data, all numbers went to 0s and no matter what tests I run the coverage stayed 0. What's going on? I tried everything I could think of, changing settings, restarting VS and the whole system, removing all test results, obj, bin, etc. Nothing helped so far.

0
Avatar
Permanently deleted user

   Actually, in my case that was it. Microsoft Shims/Fakes. I have a project I want to test. Then, in the test project I create Microsoft Fakes Assembly for the assembly of the project I want to test. Right after that unit test coverage stops working and always shows 0s even without using shims in the code. I wonder how Microsoft Shims/Fakes prevent unit test coverage from functioning properly and what it more important how to make them work together?

0

Hello,

Please check the most common reasons for zero coverage data in the following article. As for MSFakes, dotCover supports it since version 19.3, so please make sure you are using the most recent version of dotCover. If you still observe the issue, then please collect the logs using the following article and report a new issue on our bug tracker. Thank you!

0
Avatar
Permanently deleted user

   I opened a new issue and attached the log. I still believe that this is the same as DCVR-9897. The issues explanation there looks very plausible for my case. Apparently when I "Add Fakes Assembly" for the assembly I need to measure the coverage for the binary and the PDB go out of sync and dotCover fails to go over the binary.

0

I just had this issue and found my solution to it. I had added new tests, but they didn't involve MSFakes. However, I had accidentally added the new tests as MSTest instead of MSTestv2. Once I switched them to MSTestv2, my code coverage returned.

0

Please sign in to leave a comment.