[SalesForce] Code coverage of 93% in sandbox but only 61% in production – won’t deploy

I'm doing the first major code deploy in this org.

  • Dev console tests tab shows overall coverage of 93% across all apex
  • Deploying all apex to production
  • Production has only 1 small apex class and it's test class
  • Production has no triggers
  • Production has no unmanaged packages

Validating the inbound change set gives a code coverage error saying I'm at 61%. There are no other errors in validation.

This all makes no sense – what are the common gotcha's I'm missing here?

Thanks,

Steve

Best Answer

One most important thing I would recommend is to check that all test classes are creating their own test data and do not rely on org's data.

Related Topic