You need to sign in to do that
Don't have an account?
Jorge Diaz 28
Overall ORG Code Coverage is at 68%!?
Have any of you seen this happen before. How can my ORG be at 68%????
function readOnly(count){ }
You need to sign in to do that
Don't have an account?
Hi Jorge,
It shows the test classes coverage of your ORG.
Follow these steps every time you run the code coverage to have reliable coverage details:
Navigate to Setup
In the Quick Find Search type 'Apex' and select 'Apex Test Execution'
1. Click Options
2. Deslect 'Store Only Aggregated Code Coverage' and click 'OK'
3.Click 'View test history'
4.Click 'Clear all test history'
In the Quick Find Search type 'Apex' and click 'Apex Classes'
Click 'Compile all classes'
In the Quick Find Search type 'Apex' and select 'Apex Test Execution'
Click 'Run all tests'
After the completed run, check the overall code coverage for your org by navigating to:
In the Quick Find Search type 'Apex' and click 'Apex Classes'
Click 'Estimate your organization's code coverage'
If you still lack confidence in your coverage, please use the Tooling API to determine coverage.
We can use Tooling API to calculate the coverage individually for an Apex class/Apex trigger or overall coverage.
How many lines are covered for a specific class or trigger:
SELECT NumLinesCovered, NumLinesUncovered FROM ApexCodeCoverage WHERE ApexClassOrTriggerId = '01XXXXXXXXXXXXX'
Which lines are covered for a specific class or trigger:
SELECT Coverage FROM ApexCodeCoverage WHERE ApexClassOrTriggerId = '01XXXXXXXXXXXXX'
The current org-wide coverage:
SELECT PercentCovered FROM ApexOrgWideCoverage
To test these queries you may use Workbench (workbench.developerforce.com) as follows:
Navigate to Utilities | REST Explorer
Select GET
Enter the following URL:
/services/data/v29.0/tooling/query/?q=YOUR_QUERY
where YOUR_QUERY should be the query to execute
Click 'Show Raw Response'
If you are still not confident enough, then you can do a production validation (click 'Validate Only' button in the tool you are using to deploy) and it will show errors/warnings if there is no coverage for classes.
Please mark it as the best answer so that other people would take references from it.
Thanks
But the best practice it to maintain the 75% code coverage for all the classes / triggers.
What I would suggest here is,
Take any of the 5 test classes and start working on it to increase the code coverage to 75%.
Remember any class / trigger above 1% code coverage you can able to deploy but that is not the best practice.