You need to sign in to do that
Don't have an account?
Bill Mc
Inconsistent Code Coverage results
Hello everyone. I have come upon an issue which is prohibiting our deployment of new components (even non-code items like templates) .
When we attempt to deploy a new changeset to production (even one without new APEX code) the system runs though our test cases as expected. However, it replies with an error stating our code coverage is at 54% and thus cannot execute the deployment.
However, when I run ALL Tests via the Developer Console and then use the Tooling API to retrieve the system wide code coverage (SELECT PercentCovered
FROM ApexOrgWideCoverage) it states 85%. This apears correct to me when inspecting the coverage percentage by class and computing the total percentage.
My question is: Has anyone else encountered this issue and if so can they offer any advice as to how to resolve it?
I have asked Salesforce for support by theu referred me here.
Kind regards,
Bill McLaughlin
When we attempt to deploy a new changeset to production (even one without new APEX code) the system runs though our test cases as expected. However, it replies with an error stating our code coverage is at 54% and thus cannot execute the deployment.
However, when I run ALL Tests via the Developer Console and then use the Tooling API to retrieve the system wide code coverage (SELECT PercentCovered
FROM ApexOrgWideCoverage) it states 85%. This apears correct to me when inspecting the coverage percentage by class and computing the total percentage.
My question is: Has anyone else encountered this issue and if so can they offer any advice as to how to resolve it?
I have asked Salesforce for support by theu referred me here.
Kind regards,
Bill McLaughlin
I tend to use the Force.com IDE to get the real picture - it takes longer but I've found its more accurate.
Use Force.com IDE, that will give you consistent code coverage result.
Many thanks for your reply. I can understand that ignored classes would lower the coverage total. Is there a way to find out which classes have no tests?
Also, I am familiar with the Force.com IDE but cannot see how to run all tests. (I think I can see how to run an individual one by right-clicking on it and selecting Force.com--> Run test. But even doing that appears to run all tests.)
What is the best method for running all tests and how do I get the total code coverege result when they are completed?
Your help is very much appreciated.
Bill
Do I now need to copy each of these these values and calculate a percentage myself?
Also, I have a total of 38 APEX classes. Is there a way to identify which havent been tested other than manually comparing them?
Many thanks, Bill
So now how do I calculate the test coverage percentage? Do I manually take the results of each and compute the average myself by summing the percentages and taking an average?
Many thanks, Bill