1

In production, code coverage is showing 83%. In sandbox, it is showing 75%. I have just 1 apex class and associated test class I am trying to deploy to production, but it fails saying only 30% coverage. The apex class I am trying to deploy has 90% coverage, why can't I deploy this class and associated test class to production?

  • 1
    What test run level did you choose when performing the deployment? Does your unit test class use seeAllData=true? What does the actual code look like? – David Reed May 29 '19 at 0:11
  • I use the "Default" test level @DavidReed. I am not using seeAllData=true. I did notice that the test class does NOT have any assert statements, though the ape class shows 90% coverage. Would this cause an issue? – user1669296 May 29 '19 at 0:20
  • Do you have any unmanaged package installed in the org? Do you 'see' the test coverage overall and for individual classes? help.salesforce.com/… (not undermining anyone's expertise - just putting it out there for future reference!) – Prashanth K May 29 '19 at 1:37
1

I was missing a trigger in my change set. The trigger actually called the apex class, adding that fixed it.

| improve this answer | |

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.