function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
adreameradreamer 

Running test code during deployment of a single file/class

Hi All,

 

When deploying a single file/class from a dev org to a production org, does only the test code in that single file runs or the deployment of the single file kicks the test code for all classes in the production org ?.

 

Thank you very much in advance.

 

Fernando

Best Answer chosen by Admin (Salesforce Developers) 
Damien_Damien_

All test classes will re-run when you push anything to production.

All Answers

Damien_Damien_

All test classes will re-run when you push anything to production.

This was selected as the best answer
craigmhcraigmh

Yes, this is true.

 

I've had issues where I've pushed to a client's organization, and could not deploy my upload because one of their tests was failing on something completely unrelated. So now I always test not only my code in the sandbox, but I also manually run all of the tests on production beforehand as part of the upload process.

adreameradreamer

Thanks Damien !