I have set up a GitHub action that validates code changes upon a pull request. I am using the Salesforce CLI to validate (on PR) or deploy (on main
merge).
The documentation gives me several options to determine testing for this deploy.These options are NoTestRun
, RunSpecifiedTests
, RunLocalTests
, RunAllTestsInOrg
. I am currently using RunLocalTests
as so:
sfdx force:source:deploy -x output/package/package.xml --testlevel=RunLocalTests --checkonly
We work with some big orgs whose full tests take quite a while to complete. I would like to only RunSpecifiedTests
for validation but am not sure how to set up my GitHub action to dynamically know which tests to pull in. I haven't seen anything in the CLI docs to determine this.