+ Start a Discussion
dvigildvigil 

Code coverage is different from sandbox to validation in Prod thru a change set

In sandbox, test code coverage is 100% on a trigger on a custom object.  But in a change set to PROD during validation, the test code coverage is 0% and fails.  Has anyone experienced this before?

Bhawani SharmaBhawani Sharma
Please check if you are getting any exception while deploying the trigger.
dvigildvigil

Test coverage of selected Apex Trigger is 0%, at least 1% test coverage is required is all I get.

souvik9086souvik9086

Hi,

 

In the test method if you use anySELECT statement for fetching, then this comes sometimes. As in select you may get the desired data at sandbox but not in production, resulting in not covering the trigger.

 

If this post solves your problem kindly mark it as solution. if this post is helpful please throw Kudos.

Thanks

Bhawani SharmaBhawani Sharma
Have you included test class in change set which is written for this trigger testing?