Apex Tests Run While Deploying

Updated 2 days ago by Copado Solutions

Test Level Deploy Options

  • No Test Run (no apex tests are run unless it is a production deployment).
  • Run Specified Tests (only included apex test classes are run, aka fast deploy).
  • Run Local Tests (all apex test classes excluding managed packages are run).
  • Run All Tests In Org (all apex test classes including managed packages are run).

When deploying to production, Salesforce will not allow No Test Run, and it will force a Run Local Tests. Also when deploying to production, it is possible to use the option Run Specified Tests, but in order to benefit from this option you will need to include in the same step all together the Apex classes and the Apex test classes which must provide at least 75% of coverage of the code being deployed.

Bear in mind that if you are using Copado Continuous Integration and the option Run All Tests, Copado will enforce Run Local Tests. Again, if you have edited the environment record and selected the option Run All Tests, in any deployment to that environment Copado will enforce Run Local Tests.

For more information refer to Salesforces' documentation.


How did we do?