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

Apex testing - Not getting package coverage
Hi, I've created a few classes and in order to make life easy, I've decided to create a package for ease of pushing the change over to my production org.
I've never tried this approach before, so I may be missing something.
I can confirm that all the classes and controllers pass with over 75% when testing in the developer console. However, when I try to upload the package, the average test coverage is only 57%
Why could that be happening?
I'd really rather not create a change set as the are are 6 custom objects at least...
I've never tried this approach before, so I may be missing something.
I can confirm that all the classes and controllers pass with over 75% when testing in the developer console. However, when I try to upload the package, the average test coverage is only 57%
Why could that be happening?
I'd really rather not create a change set as the are are 6 custom objects at least...
While packaging all dependent components will be automatically added to package and coverage of all classes which referes uploaded components will be taken into account. That might be the reason it shows reduced coverage.
Please do this to get actual code coverage before packaging. Go to developer console->Test-Check Run asynchronously->Run All.
Afetr that from setup->Apex Classes. At the top of the apex class listing there will be two links Do Compile All classes.After compiling Click Estimate Organisations Code coverage. That will be the code coverage refered while packaging. If that give s 57% you have to improve your code coverage of classes which refers any of the uploaded component .
All Answers
While packaging all dependent components will be automatically added to package and coverage of all classes which referes uploaded components will be taken into account. That might be the reason it shows reduced coverage.
Please do this to get actual code coverage before packaging. Go to developer console->Test-Check Run asynchronously->Run All.
Afetr that from setup->Apex Classes. At the top of the apex class listing there will be two links Do Compile All classes.After compiling Click Estimate Organisations Code coverage. That will be the code coverage refered while packaging. If that give s 57% you have to improve your code coverage of classes which refers any of the uploaded component .