Copado Essentials makes it easy to follow best practices by ensuring the option to validate a Deployment or Work Item is easily accessible. Validations can help to check for missing dependencies, and offer you the ability to view any success or failure messages you'd receive during a deployment ahead of time. Much like validations performed on Inbound Change Sets, there are several levels of validations that can be selected, each of which are listed below.
Validation/Test Levels:
Default: Keeps the following default behavior. In sandbox, no tests are executed. In production, all local tests are executed if your change sets contain Apex classes or triggers. Local tests are all tests, except the ones that originate from managed packages. If your package doesn’t contain Apex components, no tests are run.
Run Specified Tests: Only the tests that you specify are run. Provide the names of test classes in a comma-separated list. Code coverage requirements differ from the default coverage requirements when using this level in production. The executed tests must cover the class or trigger in your change sets with a minimum of 75% code coverage. This coverage is computed for each class or trigger individually and is different from the overall coverage percentage.
Run Local Tests: All tests in your organization are run, except the ones that originate from installed managed packages. This test level is the default for production deployments that include Apex classes or triggers.
Run All Tests in Org: All tests in your organization are run, including tests of managed packages.
In addition to performing standard Validation actions, Copado Essentials can couple Static Code Analysis with the Validation to minimize the manual effort to ensure a deployment will be successful.
Additional Validation Options:
Include Unit Test Code Coverage Result - In addition to a successful or failed status, this option will provide the overall test code coverage result for Apex tests run.
Run Static Code Analysis for Selected Apex Classes - Using this option, static code analysis is executed using PMD for Apex classes and triggers selected or included in the deployment packages. Static code analysis supports both Classic and DX source format.
Validations are a useful tool for ensuring changes will successfully deploy between environments without error, and these additional options can bolster any pre-deployment testing. To ensure best practices are followed, we encourage the scheduling of regular test execution using CI Jobs, but for a more robust testing solution, check out our integration with Copado Robotic Testing!