0

I've got a class on my Sandbox plus a test class that tests it. The test covers 85% af the class code and test execution runs fine on the sandbox. I've already deployed the test class to to production and when I try to deploy the actual class it fails. i've been having a few problems in this org because of code coverage, but code coverage before deployment on the live org is 82%.
Yet when I deploy the class it fails. Does Salesforce not run test classes on the class being deployed? I thought it would, and therefore deployed my test class first.

  • Can you provide the specific error you are getting? – Shebin Mathew Jan 14 '14 at 13:27
  • Additionally, is it possible your production org has slightly different configurations than your sandbox (extra validation rule, workflow rule, etc.) that makes your test class act a little different? – Michael Welburn Jan 14 '14 at 13:36
  • I'v checked, and I see no workflows that should interfere with this. No validation rules active on the object, and the tests run fine on the sandbox. – akarnid Jan 14 '14 at 13:57
  • The validation rule doesn't necessarily have to be on the object you are working with in your class. All test code in production is run on a deployment, so any new validation rule could be causing errors in some of your test code already present in production. – Chris Duncombe Jan 14 '14 at 16:19
  • I decided that I wouldn't need the class (it was a trigger handler class) since I could just use OnClick Javascript to fulfill the business requirements. Thanks for the help! – akarnid Jan 15 '14 at 18:56

Your Answer

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

Browse other questions tagged or ask your own question.