2

I accidentally (but successfully) uploaded to production via change set an Apex Trigger, without also uploading a Apex Test Class (doh!).

I have the test class created and ready to deploy, but I'm not able to deploy because I get the error "Average test coverage across all Apex Classes and Triggers is 63%, at least 75% test coverage is required".

What is the best course of action. Can I just change to inactive the trigger that is causing the problems, or delete it or....

Thanks!

  • Do you get errors when using Run All Tests? – sfdcfox Jun 26 '14 at 20:19
  • Yes, but on Tests from a Managed Package, which I've been told shouldnt affect the overall Code Coverage count. – OfficeGnome Jun 26 '14 at 20:30
  • Have you only uploaded the original change set or have you uploaded and deployed it? – Jagular Jun 26 '14 at 20:50
  • uploaded and deployed – OfficeGnome Jun 26 '14 at 21:20
  • Just to reword again to hope for another response -- the Trigger is already in production - I'm trying to deploy the test class (to fix the code coverage issue - but can't because of code coverage issue). I've tried uploading the class and trigger together as part of the change set and it doesn't work. – OfficeGnome Jun 27 '14 at 9:02
1

Delete the change set from production and start again. You can clone the existing change set in the sandbox it originally came from to serve as a new starting point. With the test included in the new change set, you should be fine.

1

NEVERMIND! 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 in production. I checked the box, and rerun tests and now all is good. Phew...

  • Please mark this as the answer to your question so that the system closes it as Answered. – DavidSchach Jun 28 '14 at 1:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.