1

Every now and then I encounter the following issue after I run my test classes, they all marked as completed and pass, however the class in the section Overall code coverage shows as 0 (some of them not all).

I need then to run the individual test class for that particular class, once this was complete the class in that section is updated

Code coverage

I have try changing the option of ticked and also unticked in Always run async, all the test have been also by clicking the button run all

developer console run test

I am wondering if there is anything else I can do, as it is quite frustrating to have to search individual test class to run in order to get a better overview of the code coverage in the org

6
  • Do you share your org with anyone? It's possible to delete all code coverage at once by going to the Apex Test Execution page and clearing the history.
    – sfdcfox
    Commented Jan 12, 2021 at 23:27
  • is happening on both production and sandbox, and yeah I clear test history from view test history >> clear test data buton, and also deleted all records from "SELECT Id FROM ApexCodeCoverageAggregate"
    – manza
    Commented Jan 12, 2021 at 23:40
  • Can you check Setup > Development > Apex Test Execution > Options, and see if "Store Only Aggregated Code Coverage" is selected?
    – sfdcfox
    Commented Jan 12, 2021 at 23:43
  • @sfdcfox, at the moment all of the 3 options are unticked
    – manza
    Commented Jan 12, 2021 at 23:47
  • Hmm. I just tested this in my dev org, it seems to be working fine. How big is your org, number of classes/code approximately.
    – sfdcfox
    Commented Jan 12, 2021 at 23:50

1 Answer 1

0

In case someone is having the same issue.

I was facing the same issue for a couple of days, and in my case, I found out that it was because I was invoking a Flow from the class having the issue. I found this answer which explains a little bit why invoking Flows is a special case of Apex testing, and how to handle testing for such cases.

I hope this will be helpful to someone.

You must log in to answer this question.

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