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
XXXXXX 

Test Coverage When Creating An Unmanaged Package

I have an SF application that I need to package up for production. I have tested it thoroughly and have an 84% score from the Run All Tests button under Setup > Develop > Apex Classes. There are two triggers in the application and I have created a public class with a public static testmethod function to test those triggers. When I click the Run Test button on that class, I get a 95% score back.

 

So when I go to upload a package from this application, I get these error messages:

 

  • Test coverage of selected Apex Trigger is 0%, at least 1% test coverage is required
  • Test coverage of selected Apex Trigger is 0%, at least 1% test coverage is required
  • Average test coverage across all Apex Classes and Triggers is 56%, at least 75% test coverage is required

 

Why am I getting a DIFFERENT test coverage score when packaging than when I actually run the tests?

 

TIA

 

John

 

Best Answer chosen by Admin (Salesforce Developers) 
shillyershillyer

Hi John,

 

Did you include your test method classes in the package?

 

Hope that helps,

Sati

All Answers

shillyershillyer

Hi John,

 

Did you include your test method classes in the package?

 

Hope that helps,

Sati

This was selected as the best answer
ABCDEFGHIJKLMNOABCDEFGHIJKLMNO

That dull thud you may have just heard was my palm hitting my forehead ...