+ Start a Discussion
SKiranSKiran 

Package is not getting uploaded- 5 % code coverage error

Hi,

    I am creating a package which is referring eight classses, I have written all the test classes for them. There is trigger in the org which I havnt included in the package. Though I have written test class for it. All tests are passing but still I am getting error as 

---------

Average test coverage across all Apex Classes and Triggers is 5%, at least 75% test coverage is required.
---------
  I was hoping code coverage to be 80 to 90 % but getting as 5%. I might be missing something.  Any pointers would be helpful. Thanks in advance.
 

 

Best Answer chosen by Admin (Salesforce Developers) 
Deepak Kumar ShyoranDeepak Kumar Shyoran

Hi SKiran,

 

It might be possible that some of classes which you include in your package doesn't have some test classes and if you want to include a trigger into your package then you have write a test method which can cover the unit test coverage for that trigger. While creating a package you must have to cover atleast 75% of test coverage and at least 1% of test coverage of trigger. Force more details please visit http://forcespider.wordpress.com/  

 

Please let me know if you have any question

 

Please give kudus by hitting on start if this post help you and mark my post as a answer for your question so that it will be available as a solution for other for same type of problem .

 

Thanks 

Deepak shoyoran

 

 

 

All Answers

Deepak Kumar ShyoranDeepak Kumar Shyoran

Hi SKiran,

 

It might be possible that some of classes which you include in your package doesn't have some test classes and if you want to include a trigger into your package then you have write a test method which can cover the unit test coverage for that trigger. While creating a package you must have to cover atleast 75% of test coverage and at least 1% of test coverage of trigger. Force more details please visit http://forcespider.wordpress.com/  

 

Please let me know if you have any question

 

Please give kudus by hitting on start if this post help you and mark my post as a answer for your question so that it will be available as a solution for other for same type of problem .

 

Thanks 

Deepak shoyoran

 

 

 

This was selected as the best answer
SKiranSKiran

Hi,

 

SKiranSKiran
Thank you very much, I was missed to include test class for trigger and classes. Now I am able to bring coverage to 64%, which is the overall code coverage of my org. In the package which that I am creating, I am not adding all classes. So I was expecting more code coverage for the package because I havnt referred all the classes from org. Do I require to cover overall code from org to be more than 75%. Any pointers would be helpful.
sandeep@Salesforcesandeep@Salesforce

Do one thing

Run All test Execution and go to each classes individually to check their code eoverage you will find real coverage and if it is less then 75 please modify you test class to increase code coverage.

Deepak Kumar ShyoranDeepak Kumar Shyoran

Your welcome.

 

Please accept my post as a solution so that it will also helpful for other and give me some kudus by clicking on star.

 

Thanks 

Deepak Sheoran

Salesforce developer