Calculate dependencies and scope to relevant tests
npm install sf-delta-testsCalculate dependencies and scope to relevant tests.
  
This plugin is designed to optimize your Salesforce CI/CD pipeline by calculating only the relevant test classes that need to be run based on the metadata changes in your package. It uses the Salesforce Dependency API to determine these relationships.
``bash`
sf plugins install sf-delta-tests
To build the plugin locally, make sure to have yarn installed and run the following commands:
`bash`Install the dependencies and compile
yarn && yarn build
To use your plugin, run using the local ./bin/dev.js or ./bin/dev.cmd file.
`bash`Run using local run file.
./bin/dev.js delta test-classes -o
There should be no differences when running via the Salesforce CLI or using the local run file. However, it can be useful to link the plugin to do some additional testing or run your commands from anywhere on your machine.
`bash`Link your plugin to the sf cli
sf plugins link .To verify
sf plugins
Run only related tests
`
USAGE
$ sf delta test-classes -o
[--include-all-flows]
FLAGS
-o, --target-org=
-p, --package-path=
--always-run-test=
--[no-]include-all-flows When enabled, if any Flow is changed, include all Flows that require test coverage
based on their trigger type or process type. This ensures proper test coverage
validation since Salesforce checks coverage for all such Flows during deployment,
not just the changed ones. Use --no-include-all-flows to disable.
GLOBAL FLAGS
--flags-dir=
--json Format output as json.
DESCRIPTION
Run only related tests
Calculates the tests needed to be ran based on the changed metadata given using the Salesforce Dependency API. For
Flows, also queries FlowTestCoverage to include test classes that have previously covered the Flows.
EXAMPLES
testCmd=$(sf delta test-classes --target-org matt@never.io.dev)
$ sf project deploy validate ${testCmd}
`
Calculates the tests needed to be run based on the changed metadata given using the Salesforce Dependency API
`
Run only related tests
USAGE
$ sf delta test-classes -o
FLAGS
-o, --target-org=
-p, --package-path=
--always-run-test=
--[no-]include-all-flows When enabled, if any Flow is changed, include all Flows that require test coverage based on their trigger type
or process type. This ensures proper test coverage validation since Salesforce checks coverage for all such
Flows during deployment, not just the changed ones. Use --no-include-all-flows to disable.
GLOBAL FLAGS
--flags-dir=
--json Format output as json.
DESCRIPTION
Run only related tests
Calculates the tests needed to be ran based on the changed metadata given using the Salesforce Dependency API
EXAMPLES
testCmd=$(sf delta test-classes --target-org matt@never.io.dev)
$ sf project deploy validate ${testCmd}
``