Replies: 3 comments 2 replies
-
I am not asking for a fix to a previous issue or new issues. I am looking for new functionality to allow teams to deploy faster while running tests. AI is everywhere in Salesforce, so it would be great if it can be used with the SF CLI to determine what metadata has changed, and only run those tests associated with the change. |
Beta Was this translation helpful? Give feedback.
-
@jhgihub0 - My understanding is that Apex tests are run by default in production only if your deployment includes Apex classes or triggers as long as the API version is 34.0 or higher. This sounds different from the behavior you describe where all tests run even if deploying a single custom object. Regarding your ask for AI help to specify test classes to run, are you asking for the Salesforce CLI to...
Thanks for engaging on this idea. |
Beta Was this translation helpful? Give feedback.
-
We deploy with a package.xml and scan the package using a custom script to determine what SF CLI command to run. If the package doesn't contain Apex, we just run Ensure you do not use If the package contains Apex, then we run So technically our CI/CD process involves two package scans (1 done by our script and 1 done by Salesforce), but this was the most reliable way we've found to separate Apex vs non-Apex deployments to ensure we optimize the deployment process. If you want to avoid manual package creation, I would recommend https://github.com/scolladon/sfdx-git-delta to create delta packages based on the changed files but that is a 3rd party plugin. The guy who made that plugin does work for Salesforce though so I would advise for it and it's one of the most popular plugins. |
Beta Was this translation helpful? Give feedback.
-
We have large orgs with large deployments. Each time we do a deployment for our large orgs, even if we deploy just 1 object, it runs all the tests. For sandboxes we can specify "NoTestRun", but that is not possible for PROD deployments. These tests can take hours to run. We also have many developers working on metadata updates, so it’s not always easy to get the list of test classes associated with the change being deployed, so running specified tests is not feasible.
It would be great if Salesforce CLI can use AI to determine what has changed in the metadata since the last deployment, and only run those metadata deployments and associated tests. There are some 3rd party CLI plugins that does that, but we have open source restrictions. Something official from Salesforce would be ideal.
Is anything like this in the works, or available for us to use? If not, can this be added into Salesforce CLI?
Beta Was this translation helpful? Give feedback.
All reactions