Loading

FAQ on test execution when 'Run-All Tests' flag is deployed

Date de publication: Oct 13, 2022
Description
The following are some Q&A regarding the Run-All-Tests flag and differences in test execution when deploying to sandbox vs. production
Résolution
1. Do run-all-tests execute in production when deploying regardless of what you're deploying?
- No, some components deployed alone won't trigger tests. Running tests in a Deployment doc describes which component will invoke validation.


2. Does "run-all-tests" includes running managed package tests?

- Yes 


3. Is there a way to exclude running managed package tests when deploying or is it only possible to ignore the errors generated by these?

- Managed package tests will not be executed when deploying to production, unless you are deploying a managed package.


4. Does code coverage for managed packages test classes contribute to the overall org code coverage?

- The code coverage value computed by "Calculate your organization's code coverage" may differ from the code coverage value computed after running all unit tests using Run All Tests.  This is because "Calculate your organization's code coverage" excludes classes that are part of installed managed packages while Run All Tests doesn't.


5. What is the result of setting the runAllTests flag to true in production vs. in sandbox?

- runAllTests is a boolean parameter causing the following behavior:

In Production - if set to false, then managed package tests will not run but every other test will run.

In Sandbox - if set to false, no tests will run.



Note: Follow the article on Running a Subset of Tests in a Deployment to see how to run specific tests, subset of tests or all tests.

Numéro d’article de la base de connaissances

000384772

 
Chargement
Salesforce Help | Article