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
Mark Tyler CrawfordMark Tyler Crawford 

When you deploy an inbound change set with apex, does the validation run tests within the changeset or those already in the org?

When you deploy an inbound change set with apex code in the change set, does the validation run tests that are in the change set or those already in the org?

So lets say for example I am deploying from sandbox v1 to production. Production already has an apex class "class-v1" and a test class "test-v2". In sandbox v1, I have an apex class "class-v2" and its associated test class "test-v2". I add "class-v2" and "test-v2" to a change set and upload the change set to production. In production I click validate on the uploaded change set. When the validation runs, does the org look in the change set for "test-v2" or does it run the test that is currently on the org "test-v1"?