You need to sign in to do that
Don't have an account?

Deployment of test classes to increase code coverage failing
Can someone assist? I must be missing something.
I have 2 triggers in production and sandbox (same in both):
They have 0% coverage in production, 100% and 90+% coverage in sandbox - b/c I have the test classes in the sandbox only.
I want to deploy these test classed to production. I cannot.
The Deploy Error is "Average test coverage across all Apex Classes and Triggers is 69%, at least 75% test coverage is required."
This low coverage is what I am trying to fix by deploying test coverage. How can I increase coverage?
Thanks.
Typically that means you have other test coverage issues in your org (errors or something else). Run the "Run All Tests" in Setup / Develop / Apex Classes and look for errors.
Fix those in Sandbox - then push all of your changes up at the same time.
-Andy
I initially tried just deploying one of the test classes and the error I got referenced an uncovered trigger.
So I added the test class relevant to that trigger.
I did not see a reference to an uncovered class.
However now I added a sandbox test class for the last trigger class and receive the same message.
I am trying to up my coverage. The error message is not helpful.
Yeah - it's not helpful at all. =)
Like I said - odds are you have an error in a Test Class currently in Production. Run the "Run All Tests" button in Production and see if you get any failures. If you do - fix them in Sandbox and deploy those + your new ones in one batch.
-Andy
OK, so i need to fix all code coverage to make any changes whatsoever? that is what it apepars like.
Yeah - you can't deploy with any errors present. Fix them in the Sandbox first - then you'll be set.
I've had this happen before - but usually it's because I didn't stage my data properly in the Test Class or had a new Validation Rule get implemented that broke one. It's part of the development / testing / deployment cycle. =)
Thanks.
The error message isn't clear about what conditions need to be resolved. Also, I wonder how I got 2 apex classes / VF pages deployed in production in the past without 0% coverage.
If you run the "All Tests" button in production (Setup / Develop / Apex Classes) - in the output of that you'll find a "Failed Tests" section. If you want (and are OK with doing so) - post up the failure stuff here and we can help you parse it.
-Andy
Thanks.
I have two similar classes that allow users to add multiple related objects to one custom object.
and here is the other one. i have been able to build tests for my triggers but tests for these pages has eluded me.
i would guess the tests would be similar, no? thanks for any help!