1

I've been banging my head on this issue for a while now and I'm throwing my hands up and asking for help.

When I run all tests in my org (either via the Run All Tests button or running them all in the dev console) my estimated code coverage is 100% as well as the expected data comes back via the ToolingAPI ApexCodeCoverage call.

However, when I make a runAllTests call (API 33.0) or a testLevel="RunLocalTests" (API 34.0) the code coverage show 0% and ToolingAPI data is empty.

Is there some sort of flag I need to set to be able to have this stored and to be able to get the ApexCodeCoverage data? I've also tried doing the deploy via the MetadataAPI instead of via Ant with the same results.

2 Answers 2

2

You mentioned API v33 and RunLocalTests. I can not see any mention of RunLocalTests in Metadata API doc v33, so have to assume you meant v34, not v33.

If my assumption about the version of Metadata API is correct then you are probably having the issue described here: Metadata Deploy - test code coverage report is broken in Metadata API v34.0 (Summer 15). Test implementation in Metadata API v34 does not report coverage for classes not included in the package.

Workarounds:
- include (in the package) all classes for which you want to get coverage
- or use Tooling API
- or downgrade to Metadata API prior to v34. For instance v32. v33 will probably also work but I did not test it.

3
  • Thanks, I was afraid of something like this. My deploy.zip is empty. I'll try using the ToolingAPI. Did you ever file a ticket with support about it? If not, I can file one and get some more information. Commented Aug 8, 2015 at 23:50
  • Hi @PatrickConnelly - I did not file a ticket (can not do that from Dev org). This matter is already being taken care of by the Metadata API team. Have a look at the "accepted" answer via the link I included above. Although if you do submit a case then this may help prioritise this issue.
    – gaiser
    Commented Aug 9, 2015 at 10:02
  • I'll see about filing an issue next week. Commented Aug 9, 2015 at 11:15
0

From the Metadata API, see DeployResult. I believe that would be the Metadata you're looking for that you've not configured to have returned to you.

1
  • I get the correct information back and see that the tests run and are successful. What I don't get are any code coverage stats stored on the classes themselves. Commented Aug 8, 2015 at 23:41

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .