+ Start a Discussion
Nirmal ChristopherNirmal Christopher 

NPSP test class failure

We are trying to implement a new NPSP organization. Created a trigger and a test class but when we are trying to deploy into production and tried to run all the tests. first all the NPSP test classes failed we made some modifications in the classe and ran the tests again. Now all the test classes are passed but the code coverage is 59%. Since all these test classes comes from NPSP package we are unable to modify it. We ran the test classes in production same problem. Did any one have experienced this before?
Hi Nirmal,

If you use a "managed package" for NPSP, you should not be running into this issue, since managed packages will have a separate namespace and will not affect your org. Also, note below:
  • 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.
  • When deploying to production, all tests in your org's namespace will be run.  Managed tests will not be run by default. 
  • 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.
If this answers your question, please mark this as the Best Answer for this post, so that others can benefit from this post.