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
OfficegnomeOfficegnome 

Can't deploy to production due to code coverage

The code coverage of my Production instance dropped below 75% which has disabled the ability to move anything from Sandbox to production.
A developer - now no longer with company - helped improve in sandbox the test classes that needed to be fixed
I'd like to deploy the test classes to production, but when I try to do it via a change set I get the dreaded low coverage error (specifically "Average test coverage across all Apex Classes and Triggers is 68%, at least 75% test coverage is required")

It seems like a catch 22 -- I can't deploy the fix for the code coverage, since I don't have code coverage. :-( Any ideas?
Best Answer chosen by Officegnome
OfficegnomeOfficegnome
Figured out the issue -- we have this in our system -- https://appexchange.salesforce.com/listingDetail?listingId=a0N3000000178fsEAA
And one of the caveats for code coverage is that the system admin profile users have "assignment group" checked.  At some point I must have unchecked them.
I checked the box, and rerun tests and now all is good.  Phew...

All Answers

Vi$hVi$h
This might be because even after taking your test class fixes the total code coverage does not go above 75%
OfficegnomeOfficegnome
The average total coverage of the classes Im trying to deploy from the sandbox is 91%- i've included in my change set all the relevant classes/triggers (to essentially override what is in production).  Any ideas?
OfficegnomeOfficegnome
Figured out the issue -- we have this in our system -- https://appexchange.salesforce.com/listingDetail?listingId=a0N3000000178fsEAA
And one of the caveats for code coverage is that the system admin profile users have "assignment group" checked.  At some point I must have unchecked them.
I checked the box, and rerun tests and now all is good.  Phew...
This was selected as the best answer