function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
gaurav.sfdcgaurav.sfdc 

Test Coverage fall while uploading package

I have 83% of test coverage when I run 'run All' test. But when I try to upload a pckage from same org it failes saying 73%. What could be the possible reason of this fall of 10%

Regards
Gaurav
Tony TannousTony Tannous
Hello,

may be on the org you are trying to deploy the changeset,contains some code that is not called anymore while deploying the new code.

Regards
gaurav.sfdcgaurav.sfdc
Hi Tony, couldn't get you. I can only deploy when my package gets build. I am not able to build (upload) a package. On same org run all gives 83% but on building a package it fails saying 73%
Tony TannousTony Tannous
Hi Gaura,

what you need to do to make sure that your code coverage is ok 
Go to Setup-->Develop--> Apex Classes 

click on the link Compile all classes and after that click on the link Estimate your organization's code coverage ( you will see that it is not 83%)

Regards
gaurav.sfdcgaurav.sfdc
Hi Tony,

Above steps gave "Code Coverage: 83%Your overall code coverage is currently 83%. To deploy code to production, you must have at least 75%."

Regards
Gaurav