Print this page

Why am I getting an error in the Production during deployment when the code coverage in Sandbox is above 75%?

Knowledge Article Number 000199415
Description In the Sandbox the apex code and test classes show up with a 100% code coverage , still with the 100% coverage in Sandbox it does not mean that the Production will generate the same 100% percent during deployment. The overall code coverage of other existing components (trigger and classes) in production can be below 75%.
Resolution Please note that if the apex code and the test class have 100% code coverage and you are still unable to deploy it in production due to low code coverage. It means that the overall code coverage of other existing components (trigger and classes) in production is below 75% and the deployment will not be successful.

To avoid this:
  1. Ensure that all classes/ triggers have above 75% code coverage
  2. All classes should be valid. (Re compiled )
  3. If the production coverage is going down because of the test classes, which is coming in Dev console
    1. Please follow the Tooling API for that: Why is a Test class evaluated as part of the Organization’s Code Coverage?




promote demote