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
Marc G.ax1040Marc G.ax1040 

Code Validation Error before deployment

HI,
I am using change set to deploy my code to production so before i do that , i am validatingn my code.
Then, when i validate the components which includes a visual force page, apex class and test class for that apex class it says validtion failed bcos of an error. What's confusing me is why is the validation failing bcos of a completely different test class which i m not working with. Is this error because of pre- existing failure of test case or if  really my code is causing this error. 
My unit test cover 95% of code. Please help
steve456steve456

try to include the failed test class and deploy

 

 

or

 

 

screen shot the error so that we can scan through it

crop1645crop1645

The Validation step is done against PROD org using whatever is in PROD org plus your change set.  Validation uses all test cases, not just those you are deploying.

 

Thus, while the entire test suite may run fine in sandbox/dev org; the combination of what you are deploying plus what is also present in the PROD org will apply against the test suite in PROD

 

Either:

 

a) Your test methods in Sandbox are not 'PROD neutral' or

b) You aren't deploying everything you need in the change set