Apex Test Run While Deploying
The Test Level deploy options are the followings:
Run No Tests - No Apex test are run unless it is production deployment.
When deploying to production, Salesforce does 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. However, in order to benefit from this option, you will need to include in the same step altogether with the Apex classes and the Apex test classes which must provide at least 75% of coverage of the code being deployed.
Run Specified Tests -Â This option allows you to determine which tests you specifically want to run. This is great for deployments to staging sandboxes and provides you with the most control possible.
Run Local Tests - This option will run all tests in your organization except ones that originate from installed managed packages. This test level is the default for production deployments that include Apex classes or triggers. This is a great option to run tests that you’ve written, and which are under your control but ignoring those that may come with managed packages or installed apps. It can be a big time and frustration saver.
Run All Tests in Org - This option runs all tests in your Salesforce org, including third-party tests from managed packages.
Reference screenshot is here.
Â
- style