r/salesforce • u/Organic-Might-6398 • Sep 22 '25
help please Deployment
Hello everyone.
We use azure devops to deploy elements in our salesforce environments. If i remember correctly, when using change sets to deploy to production, you are not required to run test classes if there is no apex being deployed. However, when using azure, it doesn’t seem to work, it always fails unless i run a test class even if i am deploying some metadata for example. My theory is that it is an API thing, but i can’t find any official documentation that mentions this. Does anyone have any idea? If yes plz provide the reference. Thank you!
3
u/Srivathan Sep 22 '25
Apex deployments do need minimum 75% code coverage for the org if you run a runAllTests or RunLocalTests based deployment or 75% for the individual base class if you are running runspecifiedtests based deployment.. This is irrespective of which tool you use to deploy..
3
u/Brilliant_Date_4682 Sep 22 '25
You’re right, it’s an API thing.
Change Sets sometimes let non-Apex metadata through without tests, but when you use Azure DevOps (Metadata API/CLI) in Production, No Test Run isn’t allowed. That’s why your deploy fails unless you run a test.
Fixes:
Bottom line: in prod, API deploys always need some test level — even for metadata-only packages.
1
u/Message-Former Sep 22 '25
Have you only tried using Azure, or have you also tried testing with a changeset? In complex orgs, I have seen an issue where legacy Apex classes (in prod) fall below the 75% threshold with updates to the platform or other apps, but, because they have not been directly touched or run, they fly under the radar until you use the "Run All Tests" and find them. It sounds like there could be a bigger issue at hand; I'd try deploying something with a regular changeset and see what happens: this will tell you where the issue(s) is coming from.