A Mysterious Deployment Error
Jul 18, 2024Happy Saturday!
Quick story...
This week I was moving a batch of work between Sandboxes for a client.
There were 138 items that needed to move, and it had to be done fast.
The client wanted to demo this functionality in their full sandbox in under 2 hours.
Normally this is a simple process.
Use a change set, move the work, validate it, and then deploy.
During validation I often select the Run Specified Tests option and leave it blank (when I'm not deploying Apex).
But this time, I hit an unusual error:
Error: You must specify at least one test for Run Specified Tests Option.
Boo.
I was confused.
Why is an Apex test required?
There's no Apex in the change set!
This might be a new update in an upcoming Salesforce release, or perhaps a sandbox setting specific to this client.
At any rate, it was in the way.
To get past the error, I wrote an Apex Class designed to test nothing in order to get my changes through.
This is the Apex Test Class:
I saved my work in the developer console and was then able to reference the "testClass" when specifying a test for the deployment.
The validation worked with my "fake" testClass and I was able to get through the deployment.
Whew.
I did some searching online and didn't find any results on this error, which makes me think maybe it's part of an upcoming release.
Thought I'd share this solution with you in case you encounter a similar situation.
Hope it helps!
Best,
Nick
P.S. If you know what causes this error, comment here and tell me! :)
SalesforceĀ Saturdays
Join the Salesforce Saturday newsletter. Every Saturday, you'll get 1 actionable tip on Salesforce technology or career growthĀ related to the Salesforce Industry.
We hate SPAM. We will never sell your information, for any reason.