[SalesForce] Can’t Deploy Due to Errors in 3rd Party Packages

Short Version:

I am getting errors in 3rd party unmanaged packages that are preventing me from deploying any code to our production instance. I'm using eclipse as my IDE is their anyway to bypass the unrelated errors without having to fix / un-install the 3rd party code?

Long Version:

To set the scene its been a while since we have done any development on our own instance. Today I went to make a small change to one of our triggers (Adding a new condition to an IF statement).

For reference this is the trigger (Created as part of our Email2Case Premium):

trigger AssignAccounts on Case (before insert) {

    List<Account> acc = [SELECT id FROM Account WHERE name = '<Our Client Name>'];

    if (acc.size() == 1){
            for(Case c : trigger.new){
                 if (c.Origin == '<Our Client Name> Support - Email' || 
                     c.Origin == '<Our Client Name> Support - Phone'){
                    c.AccountId = acc.get(0).id;
            }
        }
}

However when I tried to 'Save to Server' in Eclipse I got a list of test failures all unrelated to the change I was making. These failures occurred in 2 Unmanaged packages our project manager has installed, Milestones PM (Over a year ago) and Time Off Manager (2 months ago).

Description Resource    Path    Location    Type
System.AssertException: Assertion Failed    Milestone1_Charts_GanttController.cls   /our_instance/src/classes   line 134    Force.com run test failure
System.DmlException: Insert failed. First exception on row 0; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, Milestone1_Milestone_Trigger: execution of AfterUpdate
caused by: System.LimitException: Too many SOQL queries: 101
Class.Milestone1_Milestone_Trigger_Utility.updateProjects: line 310, column 1
Class.Milestone1_Milestone_Trigger_Utility.updateParents: line 264, column 1
Class.Milestone1_Milestone_Trigger_Utility.handleMilestoneAfterTrigger: line 231, column 1
Trigger.Milestone1_Milestone_Trigger: line 22, column 1: [] Milestone1_XML_Import_Utility_Test.cls  /our_instance/src/classes   line 41 Force.com run test failure
System.DmlException: Insert failed. First exception on row 0; first error: FIELD_CUSTOM_VALIDATION_EXCEPTION, Maximum per user chatter subscription limit has been exceeded: [] Milestone1_Task_Chatter_Tst.cls /our_instance/src/classes   line 60 Force.com run test failure
System.DmlException: Update failed. First exception on row 0 with id a0RD0000005B4YpMAK; first error: TRANSFER_REQUIRES_READ, The new owner must have read permission: []   tom_test_cancellation.cls   /our_instance/src/classes   line 37 Force.com run test failure
System.DmlException: Update failed. First exception on row 0 with id a0RD0000005B4Z7MAK; first error: TRANSFER_REQUIRES_READ, The new owner must have read permission: []   tom_test_status_changes.cls /our_instance/src/classes   line 96 Force.com run test failure
System.LimitException: Too many SOQL queries: 101   Milestone1_Test_Move.cls    /our_instance/src/classes   line 306    Force.com run test failure
System.QueryException: List has more than 1 row for assignment to SObject   tom_test_error_conditions.cls   /our_instance/src/classes   line 11 Force.com run test failure

So my question comes down to, Is there a way I can make my changes without having to fix this 3rd party code or un-install them? Having a look at the errors it may be possible to fix the Assertion Errors but the rest will mean going through the entire package.

Also I would be interested if anyone can tell me how these packages managed to get installed in the first place if their unit tests failed?

Best Answer

Jon,

It was previously possible to install managed packages and Ignore APEX Test Errors this isn't the case anymore.

Your probably going to have to uninstall them if you want to deploy from Sandbox to production, and reinstall them.

If it's Milestones PM (the package) is you can probably get an unmanaged version to work with and fix the bugs.

UPDATE

Looks like you are using the unmanaged package. So I think if you don't want to uninstall before going to production your going to have to fix those errors manually by fixing the code.

Unfortunately, SFDC test methods don't live in a complete vacuum where you can run tests against your org without bumping other code, even when you go to deploy.

Related Topic