Code coverage % showing zero when in two different code versions.

Just had a call from a client and think we've found found an interesting bug and wondered if anyone else has had the same issue before and if I'm on the right track...

Sometimes code coverage on classes would show Zero when actually they have tests against them after a lot of fiddling the issue seems to be because the test class and the code class were assigned to different versions after matching up the versions the code coverage %age then appears.

Yes, I have also started to see this recently. Sounds like there is a change salesforce made to code coverage.

To fix our problem, we simply create a new eclipse project, ran the upgrade wizard to update all the class version. [or you know, manually edited the metadata.xml secretly ;-)] and ran all tests again.

SummaryWith the Winter '14 release, certain code scenarios are producing 0% code coverage for certain classes. The corresponding rows for effected classes in the ApexCodeCoverage table are not present.

If you are effected by this issue, please review the scenarios listed below to confirm that symptoms and behaviors are correct. If your symptoms and behaviors are different, please log a case with Salesforce support with a detailed description of your issue.

ReproScenario 1: A test method that invokes a batch Apex class. The test and batch methods execute successfully. The class has zero % code coverage in the Apex class detail page and the Overall Code Coverage panel in the Developer console.

WorkaroundScenario 1 Work Around: Edit and Save the test class or Compile all classes from the Apex class list page.