+ Start a Discussion
SFDC coderSFDC coder 

Deployment fails even when code coverage is >75%in sandbox

Hello All,

There are no classes and triggers on the production org and am moving the apex code for the first time. The deployment is constantly failing even if the code coverage is 79% in the sandbox. The reason is shown as code coverage in production is 66 %

I checked my classes and i haven't mentioned see all dtaa tru anywhere in the test class
Can anyone please help me solve this issue?
Best Answer chosen by SFDC coder
sandeep sankhlasandeep sankhla
Hi SFDC,

Here we can do only one thing...because it gives false result many times and this is known issue....you can check with eclipse or mavensmate  if that is also same then we should see what to do else if they are giving less percentage then you can increase the coverage .....and actually you can increase it to above 90 then deploy....

Thanks,
Sandeep

All Answers

sandeep sankhlasandeep sankhla
Hi SFDC,

Are you checking code coverage from developer console, setup or eclipse in sandbox ? because sometime these three gives different results..

Go to setup --> classess--? click on estimate organization coverage that will show ypu overall how much it is ..check and let me knwo that is above 75%..

Thanks,
Sandeep
SFDC coderSFDC coder
Hi sandeep,

Thanks for your quick response.i followed your steps and it still shows 79 % . What else can be done?
sandeep sankhlasandeep sankhla
Hi,

Can you share the screen shot of both, sandobox code coverage result and production failure ?

 
Shrikant BagalShrikant Bagal
Hello SFDC coder,

Could you please the code covrage for your Production Organization.
Because Whenever your start deployment, the code covrage of production is also verified.

Hope its help you!!

Thanks!
SFDC coderSFDC coder
pic 1 is of snadbox
User-added image

below pic is of production
User-added image
 
SFDC coderSFDC coder
Hi Shrikant,

AS i mentioned earlier, the code coverage of produciton is 0 % since am moving the code for the first time in my production org

Thanks and Regrads
sandeep sankhlasandeep sankhla
Hi,

It seems weired and it is giving false no of percentage because if it is more than 75%, then it does not give this sentecne,which says you must have 75% to deplo..

can you check with mavensmate or eclipse if they are also giving the same percentage ?

 
Shrikant BagalShrikant Bagal
Hi SFDC coder,

As you mention ,There are no classes and triggers on the production org and am moving the apex code for the first time so the code covrage was not checked for production.
Please make sure the code covrage of production should be 75%.
we got the Problem !!!
 
sandeep sankhlasandeep sankhla
Hi SFDC,

Here we can do only one thing...because it gives false result many times and this is known issue....you can check with eclipse or mavensmate  if that is also same then we should see what to do else if they are giving less percentage then you can increase the coverage .....and actually you can increase it to above 90 then deploy....

Thanks,
Sandeep
This was selected as the best answer
ManojjenaManojjena
HI Sfdc Coder,

You can check one thing ,as you don't have seeAllData=true .You test record have some hard coded record id . Then it wil not match in production and will give less coverage .

Please cross check if you have less number of test class .
SFDC coderSFDC coder
Hi sandeep,

You were right. when i checked in eclipse it shows a different figure i.e 68 %. Thanks for your suggestion

@Manoj: Thanks for your reply as well

Best Regards,
SFDC coder
AnanimforceAnanimforce
could be you didn't run the right test.