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
AustralianBobAustralianBob 

Deployment failing in Prod - Milestones PM class

Hi, a classic "new to Apex" questions - sorry.

Story is, we have Milestones PM, the package includes Apex which works it's magic for us - seriously quite a good app! :)

We have another unrelated piece of APEX for logging "Previous Owner" on Account Changes, we'd like to deactivate this. 

When we try to deploy the inactive Trigger from Sandbox to Prod there are errors.

A couple are caused by Validation Rules that have "grown" in the Org - not ideal, but we can spin these down to allow deployment and spin them back up.

The Milestone PM Class "Milestone1_repeatCon" is raising errors that I can't resolve though.

To add to it, when using "Run Test" the errors occur in Prod but pass with flying colours in SB :|

The error is "System.AssertException: Assertion Failed: Expected: false, Actual: true

Class.Milestone1_repeatCon.testController: line 340, column 1"

 

Any guidance would be appreciated!

The irony is, we're trying to spin down the Previous Owner APEX to replace with Flow Triggers!!!

 

Best Answer chosen by AustralianBob
rohitsfdcrohitsfdc
Assert statement assures you the code is working as expected. But if your functionality is working fine, and you are getting good coverage of the code, i dont see any negative impact on the system.

All the errors you stated above are assertion failures. Try commeting them out if that helps you.


If my answers solves your problem, please mark it as Best Answer, so that other can take benefit of this post.


All Answers

rohitsfdcrohitsfdc
Hello AustralianBob,
You are not the first person that is facing this issue. I have worked with various clients who has faced the same issue with milestone app.

As you know, Milestone is an unmanaged package and if you change anything on standard objects or the Project object, it may affect its test classes' execution.

Simpler way is : try to comment the assert statements. I know it is not the best solution, but that is best you can you do by yourself since you are new to Apex.

Or let me know, i will help you out.

Thanks
Rohit
AustralianBobAustralianBob

Hey Rohit, thanks for jumping in to help! :)

Commenting out did cross my mind, and we may have to head down that path. Are there any negative impacts that you know of doing this in the repeatcon Class for Milestones? or hard to say?
 

I am hopeful that there is something to be done, given that the Test works in Sandbox, and 5 of the 9 executions pass in Production, and all the failures are similar... I will have a look to see if there are any customisations or validation rules I may have missed, here's the Run Test Log if it helps?

Class|Method|Pass/Fail|Error Message

  • Milestone1_repeatCon testController Fail System.AssertException: Assertion Failed: Expected: false  Actual: true Class.Milestone1_repeatCon.testController: line 340,  column 1
  • Milestone1_repeatCon testControllerFilterAllItems Pass
  • Milestone1_repeatCon testControllerFilterAllItemsWithBlankProject Fail System.AssertException: Assertion Failed: Expected: false  Actual: true Class.Milestone1_repeatCon.testControllerFilterAllItemsWithBlankProject: line 551,  column 1
  • Milestone1_repeatCon testControllerFilterMilestones Pass
  • Milestone1_repeatCon testControllerFilterMilestonesWithBlankProject Fail System.AssertException: Assertion Failed: Expected: false  Actual: true Class.Milestone1_repeatCon.testControllerFilterMilestonesWithBlankProject: line 636,  column 1
  • Milestone1_repeatCon testControllerFilterMyProjects Pass
  • Milestone1_repeatCon testControllerFilterMyProjectsWithBlankProject Fail System.AssertException: Assertion Failed: Expected: false  Actual: true Class.Milestone1_repeatCon.testControllerFilterMyProjectsWithBlankProject: line 596,  column 1
  • Milestone1_repeatCon testControllerFilterTasks Pass
  • Milestone1_repeatCon testControllerFilterTasksWithBlankProject Pass
rohitsfdcrohitsfdc
Assert statement assures you the code is working as expected. But if your functionality is working fine, and you are getting good coverage of the code, i dont see any negative impact on the system.

All the errors you stated above are assertion failures. Try commeting them out if that helps you.


If my answers solves your problem, please mark it as Best Answer, so that other can take benefit of this post.


This was selected as the best answer
AustralianBobAustralianBob

Hey Rohitsfdc,

I bit the bullet and commented out the lines, it led to a couple of other lines to cause the same error! I took a deep breath and commented these out, and was then able to deploy :)

Thank you for your help with this! Saved manually re-creating a VERY complex Flow from SB to Prod.

Do you think it's worth us trying to trouble shoot the code to be able to uncomment the lines, or just be happy things are working?