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
stevedotstevedot 

test class deployment failed with "Code Coverage Error"

Hi Guys,

I'm trying to up the Code Coverage from 73% to at least 75%, but all the test classes that I'm trying to deploy failed with the error:

"Your organization's code coverage is 73%. You need at least 75% coverage to complete this deployment."

This doesn't make much sense. How can I increase the code coverage when Test Class deployment failed with that error.

Best Answer chosen by stevedot
bob_buzzardbob_buzzard
The way that deployment works is that your test classes will be installed but not committed when the unit tests run, so the 73% refers to the code coverage after your newly deployed test classes have been included.

This means that even with your new test classes the coverage is still too low to allow the deployment to be committed.  You need to include more test classes or up the coverage in your test classes that you are trying to deploy in order for the deployment to complete.