Apex Tests Run While Deploying

Updated 20 hours ago by Iván Minaya

Test Level deploy options

  • No Test Run (not apex test are run unless is a production deployment)
  • Run Specified Tests (only included apex test classes will run, aka Fast Deploy)
  • Run Local Tests (all apex test classes excluding managed packages)
  • Run All Tests In Org (all apex test classes including managed packages)

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's 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 using 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", any deployment to that environment Copado will enforce Run Local Tests.

More information in salesforce documentation.

How did we do?