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
SKiranSKiran 

Unmanaged package code coverall and total coverage

Hi,

   I am creating an unmanged package where I need few classes from org. I have done code coverage for those classes. But still while uploading package it is failing becuase of less code coverage i.e. 64%. 64% is my orgs total coverage. But I do not refer all class in my package. I need only few of them for which I have written test class. I am expecting a coverage of 90% for package. Do I require to increase overall org's code coverage to create unmanaged package. Any pointers would be helpful.

Deepak Kumar ShyoranDeepak Kumar Shyoran

If you want to include few selected item to your unmanaged package then you don't need to increase the overall test coverage for your organization, In that case you only need to cover the test coverage for those classes and trigger which you want to include in your package please include only those item into your package and their respective test classes also to your new package. From Create>Package>Componet Type > Add to package.

 

 

Please give kudus by hitting on star 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 .

Avidev9Avidev9
Well overal code coverage is not important for uploading packages. I am just guessing and seems like you are not creating test data in your test classes and may be depending on the org data to test.

Due to this the coverage is going down. Make sure you are creating your own test data.