You need to sign in to do that
Don't have an account?
a!
Code coverage across all Apex Classes and Triggers is 69%, at least 75% test coverage is required
Hi to all,
I have made some code changes in 2 apex classes, when i deploying these two apex classes, it throughs an error like this
: Average Test Coverage across all Apex classes and Triggers is 69%, atleast 75% test coverage is required.
when i run those 2 test classes, its test coverage is 84% and 86%.
I have deployd with change sets and also i try with Eclipse, getting the same error.
Please help me on this error, colud you please suggest any ideas or suggestons it will be greatly apriciated.
Thanking You in Advance.
When you deploy your code, salesforce calculates your total organization code coverage, not only for the classes you are deploying. Your individual classes code coverage might be 82/84 % but code coverage for your all classes is 69%. You need to increase your overall code coverage of the org.
You can go to apex classes pages, and click on "Estimate your organization's code coverage" to see your overall coverage of the org. This has to be 75+.
All Answers
When you deploy your code, salesforce calculates your total organization code coverage, not only for the classes you are deploying. Your individual classes code coverage might be 82/84 % but code coverage for your all classes is 69%. You need to increase your overall code coverage of the org.
You can go to apex classes pages, and click on "Estimate your organization's code coverage" to see your overall coverage of the org. This has to be 75+.
Hello,
I don't think your problem is specific to these 2 classes but to overall code on your Org.
Were new classes or triggers added, without test classes being implemented?
Regards
Thanks Bhardwaj,
in my sandbox, overall coverage is 71 %.
i have one more dout, i want to maintain same thing in the production also?
Thanks.
When you deploy your code to Production, sfdc runs all the test classes on production only, not on your sandbox. As you can't change any code on Production, you have to make changes in sandbox to make code coverage 75%+. So your production test coverage has to be 75%+ including your current deployment classes.
Thanks alot,
But in my org some thirdpatry packages are installed, when am running all test classes, some of the package test classes are failed.
how can we increase code coverage for installed packages
Thanks VBS,
in my sandbox now code coverage is 77%, where as in production code coverage is 62%, can i deploy the code from sandbox to production.
Now in my Samdbox code coverage is 75%, but am getting the error as
"Apex Classes and Triggers is 69%, at least 75% test coverage is require"
Please suggest me, is there any way to deploy the code.
Its Very Urgent, i want to deploy the code in Production.
Thanking you in Advance.
The only alternative is to compare the test classes which have increased test class coverage on sandbox and include them in your deployment package/changeset. There is no alternative to deploying to production other than ensuring the test coverage requirement.
Finally i deployed the code from Dev to Prod by increasing the code coverage in sandbox.
Thanks to every one.