function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
louisslouiss 

0% Overall Code Coverage - Nothing Failing Tests

Hello!

I'm hoping someone can help. I've got 0% code coverage in a production org I'm working on but the only tests failing 7/363 are from managed packages.

Is there anything else that can cause the code coverage issue?

Thanks!

 
Best Answer chosen by louiss
logontokartiklogontokartik
Can you try to try to

1, Compile all your classes
2. Clear test data
3. Run all test again

All Answers

logontokartiklogontokartik
Can you try to try to

1, Compile all your classes
2. Clear test data
3. Run all test again
This was selected as the best answer
louisslouiss
Hi - thanks for helping - still at 0% unfortunately. There were some old inactive triggers in the org that were deleted via the IDE - I don't know if that could be anything to do with it. There are now no triggers or test classes in the org other than those from managed packages installed via the app exchange.
louisslouiss
Managed to fix this by deploying a simple trigger and associated test - seems to have recalculated the overall code coverage as a result. I've marked a best answer as I'm sure this would work in 99.9% of situations.
Miroslav SmukovMiroslav Smukov

I had the same issue and I managed to solve it in a different way as the suggested answer didn't help me. I'm posting here the solution in case somebody in future faces the same problem and needs a reliable way to get the Code Coverage.

For me the Test Code Coverage only appears if I run the tests from Setup: Setup > Build > Develop > Apex Test Execution > Select Tests.. > (select your namespace and test classes) > Run

This way I get both the code highlight and coverage percentage in Developer Console immediately after the tests completes. On the other hand, if I run the tests directly from Developer Console I get non of those.