Skip to main content
Hello all.

Here’s the scoop – I have a new SFDC instance – and a pre-existing SFDC instance with adequate code-coverage.

I need to move several triggers and classes from the pre-existing instance to the new instance.

When I move the classes over, the code-coverage is dramatically lower – now 66% - which is obviously preventing me from migrating the code to Production.

 

In some cases, the classes are covered in the same amount.

In other cases, a class that is covered 98% (67/68 lines) in the pre-existing instance is now covered 7% (5/68 lines) in the new instance.

I’ve moved over all test cases related to the classes that I’ve moved.

I’ve also completely cleared the test results per this article (https://help.salesforce.com/HTViewSolution?id=000213655&language=en_US) and I’m still at 66%

 

In looking at the Developer Console, I can see lines that are covered in the pre-existing instance (that are not covered/red in the new instance), but how do I determine WHAT test class is covering the code – that I’m evidently missing in the new instance?

 

Any help would be GREATLY appreciated.

 

Thanks!

  -Chuck
4 answers
  1. Aug 19, 2015, 5:51 AM
    Use the query SELECT id,ApexClassOrTrigger.Name, NumLinesCovered, NumLinesUncovered FROM ApexCodeCoverageAggregate where ApexClassOrTrigger.Name='<ApexClassorTriggerName>' in developer console and delete the record. Then reopen the browser then run the test class.

    Run all test is not giving correct coverage all the time. You can run it seperatly, it will give correct coverage

    In Developer console you can select your method to check the coverage from particular method for the class

    Thanks

    Shaijan
0/9000