You need to sign in to do that
Don't have an account?
Girbson Bijou 8
Code Coverage Production Vs Sandbox
Hi All,
I have a class where the Coverage is 91% in a sandbox. But, when I am deploying it to the production, i received code Coverage error and it is 0%. Where do you think the problem is.
Best,
I have a class where the Coverage is 91% in a sandbox. But, when I am deploying it to the production, i received code Coverage error and it is 0%. Where do you think the problem is.
Best,
It is not recommended to use seeAllData as true, can you please set it to False and try to ceate the data in your test class itself. In this way you will get the right coverage in both the sandbox and production. Please let me know if you need any help in creating the test data.
Thanks,
Abhishek Bansal.
All Answers
When Apex is deployed to production or uploaded as part of a package to the Salesforce AppExchange, Salesforce runs local tests in the destination organization. Sandbox and production environments often don’t contain the same data and metadata, so the code coverage results don’t always match. If code coverage is less than 75% in production, increase the coverage to be able to deploy or upload your code. The following are common causes for the discrepancies in code coverage numbers between your development or sandbox environment and production. This information can help you troubleshoot and reconcile those differences.
I recommend reviewing the following documentation
If you find this information helpful, please mark this answer as Best. It may help others in the community. Thank You!
seeAllData is true
It is not recommended to use seeAllData as true, can you please set it to False and try to ceate the data in your test class itself. In this way you will get the right coverage in both the sandbox and production. Please let me know if you need any help in creating the test data.
Thanks,
Abhishek Bansal.
I put seeAllData as false and i still have 0% coverage in the production. I want to notice that the class has an invocable method which is used in a process builder.