Loading

Code coverage error during deployment when test coverage is over 75

게시 일자: Oct 13, 2022
상세 설명
As of Winter 14, the link named "Calculate your organization's code coverage" was changed to "Estimate your organization's code coverage".
솔루션

During deployment when you're getting different components in Salesforce, the test code coverage calculation will be done in real time and cannot be done before hand.

Example: I have 100 classes in my org and my test code coverage is 80%.
I deploy 50 classes and they don't have test classes.
Think by how much % the test code coverage will go down and that's can't be predicted till you actually start a deployment.
The new calculation will be done based off (100+50) classes during deployment.
Test code coverage for 100 classes was 80% but not for 150.
 
You shouldn't rely on the link "Estimate your organization's code coverage" during deployment.
The calculation will be different during deployment based off the components you are deploying.
Even a small change will impact the test code coverage.
The number you see during deployment is accurate and based off the current components in the org and the new components you are deploying.

Here are the list of components that trigger "run all tests" during deployment and impact the test code coverage 
Running Tests in a deployment
How Code Coverage works
 
How to resolve the test code coverage issue during deployment-
a) Identify test classes that have code coverage under 75.
Work on getting their test code coverage above 75%.

b) Identify classes that don't have test classes.
Work on getting test classes for them.

c) You will need to push test classes till the test code coverage goes above 75% for the org.
Knowledge 기사 번호

000385908

 
로드 중
Salesforce Help | Article