forcedotcom / devops-center-feedback

61 stars 2 forks source link

Force Unit Tests Pass Before Promoting to Next Stage #110

Open kfidelak94 opened 2 years ago

kfidelak94 commented 2 years ago
Originally posted by **matthewpomar** February 18, 2022 Hi, Is there a way to automatically ensure all unit tests pass before changes are merged into the integration stage/branch? For example, an admin creates a validation rule that breaks 14 processes/flow/triggers and 30 Apex tests. The validation rule is promoted from the admin's development sandbox to the integration sandbox. The tests all fail in that integration environment now and other admins/developers are unable to test their changes there. Would be nice to force all Apex tests pass before a change is allowed into the integration stage (or any stage of choice).
geomuck commented 2 years ago

For sure! If you specify a different test option during deployment, you can choose to run whatever tests you like! Take a look at these links and see if they make sense, and follow up here with any additional questions?

https://developer.salesforce.com/docs/atlas.en-us.daas.meta/daas/forcemigrationtool_deploy.htm#ant_deploy_testLevel https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_deploy_run_local_tests.htm

matthewpomar commented 2 years ago

Thanks @kfidelak94 @geomuck.

I understand that using tools like the Migration Tool and other metadata deployment tools, one has an option to run tests. What I mean is, from the perspective of setting up a stage, e.g. Integration, is there a way to force any and all changes that get deployed to that stage to run and pass tests before that change is accepted. Please see my example in the original post.

Thanks again.

geomuck commented 2 years ago

Oh I misunderstood. Good suggestion! That doesn't exist today (obviously), but we'll take it as an idea for an enhancement, thank you!

uip-robot-zz commented 2 years ago

This issue has been linked to a new work item: W-10752338

Szandor72 commented 1 year ago

This would be super helpful. I think this would also mostly cover 'out of the box CI'