Salesforce's CLI now offers a fifth Apex test level next to NoTestRun, RunSpecifiedTests, RunLocalTests and RunAllTestsInOrg: RunRelevantTests. This post covers what the CLI's own help says about it, how to try it, and the questions to answer before you trust it on a production release. The facts come from sf project deploy start --help and sf project deploy validate --help in Salesforce CLI 2.130.9, checked on 5 December 2026. The help labels the level Beta, so check it again on your version before relying on any of this.

What it does
According to the CLI help, RunRelevantTests runs only the tests that are relevant to the files being deployed. Salesforce identifies them automatically from an analysis of the deployment payload and the payload's dependencies. You do not name the tests, which is the difference from RunSpecifiedTests, where the list is yours to get right.
For control, the help says you can annotate test classes so they always run in certain conditions, and it points to the @IsTest annotation in the Apex Developer Guide. We have not tested those annotation options and do not describe them here.
The coverage rule still applies
The help is explicit about coverage: each class and trigger in the deployment package must be covered by the executed tests for at least 75%. That coverage is computed for each class and trigger individually, and it is different from the overall percentage.
This is the same per-class rule RunSpecifiedTests uses, not the org-wide 75% of RunLocalTests. If you have read why one passes and the other fails with 0% coverage, the same trap exists here: a class whose tests were not selected can fail the deployment on coverage even though your org-wide number is fine.
How to try it
On a sandbox first. It is accepted by both start and validate:
sf project deploy start --source-dir force-app --target-org my-sandbox --test-level RunRelevantTests
sf project deploy validate --manifest manifest/package.xml --target-org prod --test-level RunRelevantTests
A validation is the safer way to experiment against production, because it saves nothing. Compare the tests it ran with what RunLocalTests runs for the same package, and look at the coverage section of the result. If you are not sure where to find them, see where the deployment result keeps errors and coverage.
Questions to answer before you rely on it
- Is it stable enough for your release process? The CLI help says Beta. Plan for the behaviour or flags to change.
- Do the selected tests cover every class you changed at 75%? Check the per-class coverage after your first validations, not just the pass or fail.
- What does it select for a change with no Apex? Look at a real result for one of your own packages rather than assuming.
- Can you quick deploy the validation? A quick deploy skips the tests, but only for a validation that met Salesforce's conditions. The CLI's
quickhelp says the validated deployment must itself have succeeded. See how quick deploy works for the conditions. - Who decides what is "relevant"? The selection happens inside Salesforce, so you cannot see or change the rule. Some teams want the plan visible before the deployment starts.
Where Diffbridge fits
Diffbridge takes the opposite approach to a hidden selection: it shows the test plan with the reason for each test before the deployment runs, strips unchanged Apex from the package so it cannot force a full run, and skips Apex tests when no Apex changed. You can use it alongside RunRelevantTests or instead of it. Try it free for 30 days. We build Diffbridge, so weigh that when you read the comparison.
For the other commands and flags, see the Salesforce CLI deploy commands cheat sheet.