Starting a few days ago my apex class compilation time suddenly ground to a halt. After going into the setup deployment monitoring I was at first delighted with the new deployment monitoring UI, then dismayed when I saw it was running 200+ tests to compile my apex class. Thinking it might be a maven’s mate bugs I dug into the bowels and confirmed it’s doing the deployment with the following options:
- checkOnly = false
- rollbackOnError = true
- runAllTests = false
- runTests = []
- purgeOnDelete = false
Strangely, after canceling the deployment several times it switched back to not running tests when I deployed. Unfortunately the next class I moved to exhibited the same issue, only a different set of tests. Even stranger, it failed out my deploy when an unrelated test failed.
If I’m working on a sandbox, using api version 29 for the deployments, and the v29 metadata api, with deploy options that don’t imply any tests should be run, seems like this shouldn’t be happening.
I’ve scoured the spring and winter ’14 release notes and couldn’t find any mentioned of altered testing behavior (although admittedly it’s pretty easy to get lost in them). Is anyone aware of what might be causing this and what options I have to work around them? Seems like the metadata api is ignoring the parameters and instead running all tests the reference a class, but only in certain instances …
Answer
I wonder if there is possibly a bug introduced. I was just in a meeting with a couple people from Salesforce and one of the features they described in the new Spring’15 release was that you can do quick deployments.
Essentially, if I understood correctly, you can validate a deployment and it will keep those results for up to 4 days. Then when you are ready to deploy the code, you can deploy it directly without running the tests for a faster deploy time.
I haven’t tested this scenario myself or had any issues. But I wanted to let you know that there ARE some changes to the deployment process with the new release.
Attribution
Source : Link , Question Author : Ralph Callaway , Answer Author : JRiffe