You need to sign in to do that
Don't have an account?
Sumant Hegde
Code Coverage Failure error in the production deployment
Hi, I have written 4 triggers and test classes for those triggers in sandbox. It shows "Your overall code coverage is currently 100%". But when I try to deploy it in the production, I am getting the following error
"Code Coverage Failure:
Your organization's code coverage is 0%. You need at least 75% coverage to complete this deployment. Also, the following triggers have 0% code coverage. Each trigger must have at least 1% code coverage."
Any help would be highly appreciated.
"Code Coverage Failure:
Your organization's code coverage is 0%. You need at least 75% coverage to complete this deployment. Also, the following triggers have 0% code coverage. Each trigger must have at least 1% code coverage."
Any help would be highly appreciated.
We figured out the issue. It was a very silly mistake from our side. We were not deploying the test scripts along with the triggers that is why it was failing. When we deployed the trigger and the test script in the production. It worked.
Thanks for your suggestions though.
All Answers
Log into production and run all tests, if they pass then the issue is that while your tests pass in the sandbox, they fail in production. This usually happens due to hardcoding of record IDs, or the reliance of your tests on existing data in Salesforce. It might also happen if your tests use some objects that are not yet deployed to production, or when the objects do exist there but were modified in the sandbox and do not exactly match what is in production.
We figured out the issue. It was a very silly mistake from our side. We were not deploying the test scripts along with the triggers that is why it was failing. When we deployed the trigger and the test script in the production. It worked.
Thanks for your suggestions though.