1

Hi i have a changeset which has 2 apex class and their test classes with 65% and 80% individually test coverage, if i choose a option of run specified test, will that be deployed? Because one of apex class is having 65%, do it require 75% for individual components?

1 Answer 1

5

No, it will not deploy. If you choose a test level of less than RunLocalTests, each unit will be required to achieve 75% coverage each, regardless of the average. Either run all tests, or fix the tests so the 65% coverage file achieves at least 75%. This in the release notes and documentation:

When running a subset of tests, code coverage is computed for each class and trigger individually and is different than the overall coverage percentage. If your deployment package contains Apex classes and triggers, the executed tests must cover each class and trigger for a minimum of 75% code coverage. --Emphasis mine

2
  • 1
    When you deploy an inbound change set with an apex class and an apex test class, does the change set validation run the tests that were uploaded in the change set or those already in the org? Commented Jun 19, 2019 at 15:36
  • @MarkCrawford As long as the test is included in the change set, the new version will be run.
    – sfdcfox
    Commented Jun 19, 2019 at 15:43

You must log in to answer this question.

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