Run Relevant Tests in Spring '26
Salesforce's Spring '26 introduces a beta feature called Run Relevant Tests that automates selecting Apex tests to run during deployment. This can speed up deployments by only running tests directly tied to changed code, but it may miss indirect dependencies, requiring cautious use especially in complex orgs. New @IsTest annotation parameters let you mark critical tests or explicitly tie tests to specific classes to ensure key areas are covered. Developers should weigh faster deployment against test coverage confidence and can use annotations to maintain control as the feature matures.
- Use RunRelevantTests to speed deployments by auto-selecting tests based on changed Apex code.
- Mark critical tests with @IsTest(critical=true) to always run them regardless of change scope.
- Use @IsTest(testFor='...') to tightly couple tests to specific classes or triggers.
- RunRelevantTests currently only detects direct dependencies, not dynamic or chained ones.
- For high confidence, supplement RunRelevantTests with annotations or run all tests in sensitive environments.
Image created by GPT5.2 based on a prompt by Bob Buzzard Introduction The Spring '26 release of Salesforce introduces a new way to execute tests when deploying - Run Relevant Tests . Specifying this option essentially hands over responsibility to Salesforce to identify and execute the tests associated with any Apex code in the deployment payload. Note that this is in beta in Spring '26, and everything following was based on trying it out in a pre-release org in the first half of January 2026, so really early days for it. This is the archetypal double-edged sword in my view. One the one hand, deployments can run way faster with little or no human effort, especially compared to manually specifying the tests that should be executed. On the other hand, it's abdicating responsibility for the quality of the deployment.