0

All of test classes have code coverage more than 90% in lower environment but when our admin move all test classes and apex class to Production.It display warning message mentioned in heading and also display below message:

Reported Changes:

  • Apex Class was Changed.
  • Test Class was Changed.
  • Existing Field was Changed.
  • Trigger Changed.

Can someone suggest me why it is causing? Our admin use Snapshot to migrate all changes from lower environment to Production.

0

It can be caused by multiple reasons. I would suggest several places to take a look at:

  1. Is there any of the test methods using seeAllData=true in your test code. If so, the differences in data set can cause the issue.
  2. Are you seeing any other errors like test case failure in your deployment? If so, fix them first.
  3. Are you using any third party packages? The differences in the versions can cause such issues as well.
  4. The differences in profile settings can be another cause.
  5. Also, accidental (or deliberate) changing Api names in production can also cause this issue.

Edit

According to your response, I guess what you need to do here is:

  1. Fix all the other issues first. Otherwise, it is too early to talk about test coverage errors.
  2. You need to keep both environments have the same versions of third party packages in order to make sure your code is developed in a valid environment. This can be a painful process depending on the complexity of those third party packages. In the most case scenario, you might need to do a sandbox refresh from your production.
  3. I don't think you need to worry about profile impacts as this point. Unless all the other issues are fixed I wouldn't recommend doing it for now.
  • Please check my response: 1.None of my test classes using seeAllData=True.As I am aware that when we use this property,it uses existing data in Org.2.I am currently looking into it as We have other CR's which is using same component(Apex Classes). 3.Yes we are using third party Package.If there is a difference in version,how can I resolve this? Could you please guide? 4.Could you please elaborate what kind of profile setting difference? 5.I did not change Api names of my existing components. – Dhananjay Patil Nov 22 '16 at 6:36
  • @DhananjayPatil I edited inline. – Lance Shi Nov 22 '16 at 6:50
  • Thanks.Migration is successful :) The issue was with sequence of the classes only.I have arranged all the classes and its trigger in such a way that it migrates to production without any error.e.g.in my case I have created triggers for Task and events and while migrating components earlier I pushed apex classes first then triggers that would cause an issue.Ideally when you migrate trigger,You should migrate its class lets say if I am migrating TaskTrigger,migrates Task related classes then go for events class and its trigger something like that. – Dhananjay Patil Nov 22 '16 at 12:13
  • @DhananjayPatil glad it works for you – Lance Shi Nov 22 '16 at 23:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.