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
Veerendar AellaVeerendar Aella 

Do we have to add test methods manually while creating a package?

Hi All,

 I am trying to create a package, during upload process getting below error even though i have code coverage more than 75% for my test classes.
Please help me.

Error:  No test methods found in the Apex code included in the package. At least 75% test coverage is required.


 
Raj VakatiRaj Vakati
Can you include test class in the package ?? You have to include the test class also in package .. Your package must contain the 75 % code coverage overall and all test class in your package have to pass .. 
 
  1. Managed package code is not included in the required code coverage calculation for deployment.  The 75% requirement is on all Apex code in your org's namespace.  Managed code has its own namespace, so it is not included.
  2. When deploying to production, all tests in your org's namespace will be run.  Managed tests will not be run by default.  
  3. If the deployment package explicitly marks runAllTests to true, managed tests will also run.  These will need to execute without any failures should the flag be set.  Despite this, the 75% requirement for code coverage is still only on unmanaged code.