0

This is a follow-up ask to this question regarding code coverage.

I've achieved 100% code coverage doing unit testing in our sandbox.

I attempted to deploy the trigger and test class to production using a change set. I receive the following error.

Code Coverage Failure
Your code coverage is 0%. You need at least 75% coverage to complete this deployment.

I then promoted the test class by itself and received no errors.

I followed this with promoting the trigger by itself. On running the validation, I received the same error.

If anyone could lend guidance as to how I should correctly deploy this trigger, or troubleshooting ideas in case I'm actually doing it correctly, I'd appreciate the help.

1
  • Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer.
    – Community Bot
    Feb 6, 2023 at 16:24

1 Answer 1

0

When deploying the change set are you running the Tests necessary for code coverage? Are they passing?

When you "Deploy" you need to "Run specified tests" and indicate the test specific to your trigger, as opposed to the "Default" setting. (You don't have to do this when deploying Test classes, which may be why that went through without issue.) Note that "validating" the change set will not do anything to help the situation, you must "Run specified tests" when actually deploying the code. If any of the tests fail you will receive 0% code coverage.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .