+ Start a Discussion
sridhar sridharsridhar sridhar 

Code changes deployment

Hi all, 

I made few changes to the  one of the Apex classes in UAT, I want to move same class into Production( already same class exist in Production) by useing change sets.

is it like same process adding classes and testclasses into change sets then validation and deploy?? 
why because same test class already exist in prodcution, so do i need to add again test class to the chang set??
which option is suitable during deployment to run test classes among four?? ..i dont want to run all the test classes in prodcution at this case  
Is it going to overwrite the exist class?? 
is there any possible errors can occur during deployment in this case?? 

Thanks in advance.
Best Answer chosen by sridhar sridhar
Lokesh KumarLokesh Kumar
Hi Sridhar,

1.Ideally, salesforce suggests run all (Only custom not managed package) test classes during Prod deployment for validating the existing functionality is not getting impacted by the new change. H3ence every time code change please run all the test classes during the deployment.

2.Regarding your Changeset component No need to add every time the existing test class in the deployment if there is no change made to the existing Class (Test Class).

3. It's Better to validate first and then Deploy Suppose your deployment is tomorrow so you can validate today itself and get to know all the issues and error one day before your actual deployment. Once Validation completed successfully it will not take much more time to deploy and if you have validated by running all the test classes then Deployment will not take more time (Hardly 1-2 min).

Let me know if you need more information on this.

Happy to hep you
Lokesh

All Answers

Lokesh KumarLokesh Kumar
Hi Sridhar,

1.Ideally, salesforce suggests run all (Only custom not managed package) test classes during Prod deployment for validating the existing functionality is not getting impacted by the new change. H3ence every time code change please run all the test classes during the deployment.

2.Regarding your Changeset component No need to add every time the existing test class in the deployment if there is no change made to the existing Class (Test Class).

3. It's Better to validate first and then Deploy Suppose your deployment is tomorrow so you can validate today itself and get to know all the issues and error one day before your actual deployment. Once Validation completed successfully it will not take much more time to deploy and if you have validated by running all the test classes then Deployment will not take more time (Hardly 1-2 min).

Let me know if you need more information on this.

Happy to hep you
Lokesh
This was selected as the best answer
sridhar sridharsridhar sridhar
Thanks lokesh, 

here comes one problem in production,, we have overall organiation code coverage 50% only in prodcution. 
if i deploy by running all test classes it might fail (i am sure it will fail  in validate part)
it it immediate requirment to be modified in production.. so i can not increase overall org code coverage at this point of time. 

instead of that what is the best possible way to deploy.. 




 
Lokesh KumarLokesh Kumar

OMG !! 

No Problem you can still deploy your class to do so.

1.Validate your change set by choosing Run specific test class only and then choose the TestClass for the same controller class and for that class you should have at least 75% code coverage if yes then you can deploy it.

NO NEED OF OVERALL COVERAGE THIS TIME.

Thanks
Lokesh

sridhar sridharsridhar sridhar
Thanks lokesh

here comes the  doubt...

during creating outbout changest in UAT do I need to add the Test class for the modified class to run specific test class in prodcution(Inbout chagesets validation or deploy)..

the same test class is existing in production it is providing code coverage more than 80% in Uat also. 

during validation or deploy we can run specified test classes for the deploying class...does it take from existing test class from prodcution or we need to add the test class form the outbout chage set?? 

i think i am bit of confusing ???? you.

here comes the comprehenced form of doubt..
if i give specified test class to run in the prodcution durin deploy or validaion... does it like  test class should be in the Inbound change set or it can fetch the specified test class from Production??

if i add test class in the outbound change set to run specifically.. for suppose the same test class existing in production...is there any conflict or error will be occur during deploy and validation.? 

 
Lokesh KumarLokesh Kumar

No Required to Add it in your outbound changeset if it is already available in Production just give the correct name of your test class.
 

Thanks
Lokesh