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
code redcode red 

Managed Package Upload Issues

Hi all;

 

I am having problems uploading a package; beta at this point, and ultimately to released. All of my code has some unit test coverage, and overall it sits at 87%. I have done ‘run all tests’ in the Apex Class, and have no (0) errors. I have run the Apex Test Execution under Settings/App Setup/Develop/Apex Test Execution with no (0) fails. I should note that I have had one class fail on and off. Sometimes I run all tests and have no fails, and other times I have one class fail. I don't know why the running of tests has different results. But at the moment I have no fails.

 

When I attempt an upload the upload fails, and the system note states; Average test coverage across all Apex Classes and Triggers is 70%, at least 75% test coverage is required.

 

But I’m at 87% based on the ‘run all tests’?

 

Has anyone encountered similar problems, and if so, how did you resolve them?

 

Thanks in advance.

Best Answer chosen by Admin (Salesforce Developers) 
HariDineshHariDinesh

Hi,

 

As per your words the Overall Site coverage is 87%, but when uploading the package you are getting less coverage.

 

The reason might be:

 All the test classes are not added to the package, Please make sure to add all the test classes to that package and try to upload the package.

 

Run all test means coverage of all the classes (Included and not included in the package).

All Answers

HariDineshHariDinesh

Hi,

 

As per your words the Overall Site coverage is 87%, but when uploading the package you are getting less coverage.

 

The reason might be:

 All the test classes are not added to the package, Please make sure to add all the test classes to that package and try to upload the package.

 

Run all test means coverage of all the classes (Included and not included in the package).

This was selected as the best answer
code redcode red

Hi HariDinesh.K,

 

After several reloads I was able to do a successful upload. As per your suggestion, I didn't have all the package components loaded...

 

Kind regards