+ Start a Discussion
Debendra Ray 8Debendra Ray 8 

Code Coverage differs in PROD and SANDBOX

I have a trigger whose code coverage is 56% in Sandbox , however while deploying in PROD the code coverage is reported as 0%.
Please help meto circumvent this issue, so that I can deploy the trigger in PROD
HelloSanHelloSan
Hi Debendra

The overall code coverage of apex classes ana triggers should be 75%,cross check whether the overal code coverage is 75% or not,otherwise the deployment will fail
Debendra Ray 8Debendra Ray 8
Hi,

Thanks - However, the error in PROD states -  Test coverage of selected Apex Trigger is 0%, at least 1% test coverage is required. Therefore, my Trigger should have qualified for this criteria.

Thanks.

Regards,

Debendra
Bhanu MaheshBhanu Mahesh
Hi 

Might be in the test class for that trigger you have used seeAllData = true in order to get the dat from your organization.

In sandbox, you may have data but in production you don't have the data to test. So the data is not available in the test class and it is not covering the trigger.

Check this once, try to insert all the records that are needed to test in the test class itself.

Regards,
Bhanu Mahesh
Sandeep Kumar 84Sandeep Kumar 84
You need to put the dml operation according to the type of trigger in the test class. seealldata is not recomended so create your own data.