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
MohaMoha 

Cannot Upload package

Hello everyone, i'm tryuing to upload a beta managed package, when i want to upload it gives me the error : 

 

Average test coverage across all Apex Classes and Triggers is 24%, at least 75% test coverage is required.

 

and when i go to the ApexClasses List and i run all  test then i click on Code Coverage it gives me 75%, it means i can upload but i dont have the possibility do to the error i wrote above

 

anyhelp please, thank you

Satish_SFDCSatish_SFDC

Hi,

May be you could clear the code coverage and try running all the tests again.

 

Hope this helps.

 

Link: http://login.salesforce.com/help/doc/en/code_manage_packages.htm

 

Regards,

Satish Kumar

MohaMoha

hello, thanks for the reply i'm still not having the ability to upload i'm stuck in the 25%, any help please i need to upload the package

Satish_SFDCSatish_SFDC

Well, There were some scenarios where clearing the test results worked fine for me.

 

The tests are run on the production instance, so there might already be existing code with poor coverage in your production instance. 

 

Regards,

Satish Kumar

MohaMoha

thanks for the reply, yes there are about 3 classes with 40 33% of coverage test, and the other classes are above of 75%,

so what do u suggest to do ???

Satish_SFDCSatish_SFDC

Are those 3 classes written by you? Can you write test code to cover those classes as well? Also in order to compensate you can write more test code in your sandbox to get even more coverage, so it finally averages out to more than 75%.

 

Regards,

Satish Kumar

MohaMoha

yes they are written by me, and i already have more than 75% of coverage code for all classes, and i have a method i couldn't write a test for it can u give me a help please ?

MohaMoha

Satish_SFDCSatish_SFDC

Hi,

You might have to create a case with salesforce regarding this. There might be some other classes, may be in some other managed packages which do not have the required coverage. Salesforce Support should be able to help here.

 

Regards,

Satish Kumar

MohaMoha

thanks for the reply, i will create a Case but i'm wondering how can i create a case and tell it to salesforce ?

MohaMoha

I Found the solution i can now upload the package, i had to add the classes in the Package manually