+ Start a Discussion

Can't create package due to test coverage

I am trying to get a handle on how to get past an error when trying to build a package.  The error is:


Package upload error. There are problems that prevent this package from being uploaded.
Average test coverage across all Apex Classes and Triggers is 27%, at least 75% test coverage is required.


I am puzzled about the 27% because when I run my packaged Apex Classes (I don't have any Triggers) individually I get 85% coverage.  See below.


WSContoller2 - 81%
setInTestMethod - 100%
wwwMyWebService - Can't run a test here.  This is a WSDL generated web service call out.


Is the 27% all Classes on my development site?  even if they aren't included in my package?


Besides the 3 classes above that I wrote, I show the following two Apex Classes that where on my development account when it was first established.  I think they are used for the "Start Here" tab.  Do they count against my code coverage percentages?

Message Edited by George1313 on 08-11-2009 07:22 PM



Only classes in your package will count. A few things to check:


1. Are any of your tests failing? Go to Setup > Devleop > Apex Classes. There's a button 'run all tests' make sure you have no failures. NB Do this even if your tests are working individually and in Eclipse.

2.  Are you including your test classes in your package?