You need to sign in to do that
Don't have an account?
Trigger code coverage showing 0% while deployment
Hi,
I have one trigger (before update) & its test class. When I run its test class from Apex Test Execution (In Production) then I get trigger code coverage as 70%. But when I try to deploy the same trigger with its test class (same as Production) from UAT to Production then all test method passes but I get code coverage as 0%.
Is their anything in settings which restrict us to count code coverage while deploying ??
I have one trigger (before update) & its test class. When I run its test class from Apex Test Execution (In Production) then I get trigger code coverage as 70%. But when I try to deploy the same trigger with its test class (same as Production) from UAT to Production then all test method passes but I get code coverage as 0%.
Is their anything in settings which restrict us to count code coverage while deploying ??
NOTE: When adding code please use the "Add a code sample" button (icon <>) to increase readability and make it easier to reference.
Yes, I am running a test class with seeAllData=true. Also, I checked with the queries & it is giving me expected data on Production as well as Sandbox environment.
Earlier I was using higher api version in Sandbox & Also, I decresed the api version to equal / lower to production api version but still did not find any luck there.
Yes offcourse, while deploying trigger, I am adding its corresponding test class.
Since it is working fine in Sandbox & giving me 70% of code coverage (as we all know 1% is enough to deploy the trigger) But I don't know why it gets stuck in deployment.
Is their any other workaround that I am missing ??? I also checked, status of trigger is active while deploying. And Trigger's test method passes successfully. But at the end it gives me Code coverage Error. I tried to debug but deployment debug is not possible as I know.
Since the entire Trigger code is quite huge so I need to simplify to make it understand. Meanwhile Can you please help me any other ways/tricks/ideas that I need to look ??
Thanks.
I am using Change Set for deployment.
Thanks