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
como_estascomo_estas 

During Installation, the Apex Tests are Failing

I'm developing a software package.  It's good to go and passes all tests when I package it as managed beta or released

 

Here's the error I'm seeing when I try to install this beta package into a sandbox in a different org  (or the released package into a non-sandbox in a different org)

 

enhancedcomponenttestsuite.testTestObject()

 

Apex Classes(XXXXX) (where XXXXX is the ID of the apex class: enhancedComponentTestSuite).

 

System.AssertException: Assertion Failed
(FormationLite)
External entry point

 

 

This isn't very informative is it?  In the test method testTestObject(), there are 40 System.assert calls.

 

Here's the crazy part though:  I commented out every single one, repackaged, and I still see this error when trying to install.  Is this error message lying to me?

 

I have no idea where to turn.  Can somebody please help me?  All I want is a meaningful error message.

Best Answer chosen by Admin (Salesforce Developers) 
saasmaintsaasmaint

Do your tests require that records be contained in the objects?  If so, when you install the package, they will obviously fail.

 

...Mike

All Answers

saasmaintsaasmaint

Do your tests require that records be contained in the objects?  If so, when you install the package, they will obviously fail.

 

...Mike

This was selected as the best answer
como_estascomo_estas

Well, I lied.  There were actually 41 System.assert calls.  The one that I overlooked was asserting that there were 3 records returned.  Duh.  Obviously there are no records in that table in the new org.

 

Thanks for taking a look!