0

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.

1
  • Did you change the logic in the Apex class? if so, if the test class was written properly it would require that it be updated to account of the new logic as well. Whatever you are changing you will need to add to the changeset.
    – Eric
    Commented Apr 19, 2017 at 6:49

2 Answers 2

1

If your code coverage had decreased after changing the main class, then you have to modify you test class and send that in the same change set.

Now whether test class is added in the change set or not, to deploy the change set, you can select 'Run specified tests' option and give your test classes in a comma separated way. This will help deploy only running the specified test class, not all test classes in your production. See the selected option

1
  • You mean Pramit. :) Commented Apr 19, 2017 at 7:11
0

If you have existing classes in Production and if you have modified them in your UAT sandbox you will have to add them to the change set and deploy.

It will overwrite your existing class, isn't that what you want? Also I'd suggest running all your test this ensures that your production environment is stable. If you don't want to run all test you can run specific test classes.

Yes there is a possibility of failures during deployment (this can happen for several reasons one of them being sandbox and production are not in sync, for example you may have a required field in production but its not required in sandbox), its always good to validate a change set before deployment.

2
  • Thanks D_K ,, here my doubt is do i need to add that test class into the change set and run individually during validation and deploy or just i can add modified class into outbound change set and in Prodcution i can specify during validation ..why because the same test class is existing in production.. i did not do any changes to the test class in uat... what ever test class is there in uat the same is there in production also... so in this case i dont want to run all test classes.. because there is code coverage issue(45% overall code coverage in Production) in production Commented Apr 19, 2017 at 6:44
  • Like santanu said if modifying your class has decreased the code coverage you will have to modify your test class to get the code coverage right. To answer your question you won't need to add your test class you can still deploy but this will affect your production org in future since 45% is not good enough. You can run specific test and deploy
    – d_k
    Commented Apr 19, 2017 at 6:54

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .