You need to sign in to do that
Don't have an account?
code coverage issue during deployment
Hi Developers,
I am Facing strange issue. My class has 94% code coverage, i checked in eclipse as well. but while deploying this class it shows code coverage failure, only 61% code coverage, Even though i used RUN specified tests option.
Any help on this will be appriciated.
I am Facing strange issue. My class has 94% code coverage, i checked in eclipse as well. but while deploying this class it shows code coverage failure, only 61% code coverage, Even though i used RUN specified tests option.
Any help on this will be appriciated.
Your sandbox and production instances have totally different data, so your tests will run on different data as well.
The way around this is to create all new records in the beginning of your test class. Make sure not to use the SeeAllData=true annotation!
Also - your production org might have certain configurations that may be generating errors in your test class and lowering its coverage. These could be validation rules, custom settings, workflows, etc.
Please let me know if this help !
Thanks
Shivdeep
All Answers
Your sandbox and production instances have totally different data, so your tests will run on different data as well.
The way around this is to create all new records in the beginning of your test class. Make sure not to use the SeeAllData=true annotation!
Also - your production org might have certain configurations that may be generating errors in your test class and lowering its coverage. These could be validation rules, custom settings, workflows, etc.
Please let me know if this help !
Thanks
Shivdeep
I have created new set of test data.