0

I'm trying to deploy from Sandbox to Production. I am running into Code coverage error. The code coverage in the developer console says 92%. But Change set deployment to production fails with the test coverage warning: "Average test coverage across all Apex classes and triggers is 74%, at least 75% test coverage is required.

  • Which Dev console. Prod or sandbox? – Eric Sep 29 '17 at 4:24
  • 1
    Do not run all tests while deploying the change set, select - Run Selected Tests and enter the test class names in the followed textarea. – Saumya Gaikwad Sep 29 '17 at 5:18
  • @Eric Prod console – Chandu Oct 3 '17 at 4:24
  • @SaumyaGaikwad Thank you, I'll try run the test class separately – Chandu Oct 3 '17 at 4:25
0

I think it may be caused by validation rule/workflow/trigger throw error in your production.

Sometimes the overall coverage in production drops below 75%, even though it was at least 75% when the components were deployed from sandbox. Test methods that have dependencies on the organization’s data and metadata can cause a drop in code coverage. If the data and metadata have changed sufficiently to alter the result of dependent test methods, some methods can fail or behave differently. In that case, certain lines are no longer covered. - https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_code_coverage_best_pract.htm

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.