function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

Deployment - code coverage Issue

Hello Everyone,

I have a question about Code Coverage, I am trying to deploy some changes i have made in one of thr Trigger and Class but i am getting this error.

Details: Average test coverage across all Apex Classes and Triggers is 72%, at least 75% test coverage is required.

My Sandbox has code coverage of 79% but when it comes to deploy - it says 72% as above (am i doing something wrong)

please help.

kumar kkkumar kk
Hi Ishchopra,

Overall code coverage of Production Classes should also be 75% and above.So you need increse your Trigger Coverage as well as increse the production classes coverage also
How I shoulb be doing that in production?
kumar kkkumar kk
First Run all Tests in Production and check which class not more than 75% and tyr increase the coverage of that particular class in sandbox and deploy to production

you mean individual classes should have 75% coverage - even 79% overall is of no use if any of the class is 75%.. correct?
kumar kkkumar kk
Overall code coverage should be more than 75%
Overall Code coverage in our sandbox is 79% but still i am getting the same error.
kumar kkkumar kk
check in production...
Sagar PareekSagar Pareek
Its couting the coverage overall including package+production org. make sure to increase the coverage of package or the production.
I would like to know please how i can i increase the code coverage in production, the only way i know is deploy from sandbox which is failing.