-
-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
V1.2.31 - Beginnings of Rollup Logger framework, massive refactor (#129)
* Start of work on #68 - begin to flesh out Rollup Logger plugin, with beginning options for Nebula Logger and simple logging framework * Fixes #125 by making the date/time/datetime comparisons as safe as possible * Fix CONCAT issue reported by Katherine West * Fixing RollupLogger instance lazy loading * Start of work to reproduce issues with multiple DML statements in the same transaction on objects with deferred Rollup actions called from Flow * Adding LWC coverage to deployment pipeline * Aligning flow engine, DLRS migration script, and LWC for Rollup Recalc App to use the same field labels/positions * Fix two straggler issues from invocable refactor - ensure grouped invocable rollups don't add the same item twice, and ensure count-based rollups properly set the recalculated value prior to returning it * Fixing issue with map key for CACHED_ROLLUPS + invocables. Bumped beta package version and beta links * Rollup class minimization (#128) * break apart mono-Rollup class * Last (?) of improvements to recursion detection after adding recursive updates to Flow integration test in extra-tests/InvocableDrivenTests.cls. Because of the way that flow alternately boxcars/queues up different updates, it's doubly important here to make sure that the records are passing through in the right order to properly trigger detection on events like reparenting AND prevent recursive updates from running unless there's been a definitive change to the calc item/rollup operation in question * Properly calculate parent items with more than 2000 child records in RollupFullBatchRecalculator * Pinned to specific LWC jest version to avoid API version issue with VS Code test runner, added test coverage for LWC and added missing RollupLogger coverage * Bumping package version from Github Action
- Loading branch information
1 parent
e9aef85
commit 59ecc3d
Showing
36 changed files
with
2,412 additions
and
1,108 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,4 +8,5 @@ debug.log | |
DEVHUB_SFDX_URL.txt | ||
PACKAGING_SFDX_URL.txt | ||
tests/apex | ||
main/default/ | ||
main/default/ | ||
coverage/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
@isTest | ||
private class InvocableDrivenTests { | ||
// Driven by extra-tests/flows/Rollup_Integration_Multiple_Deferred_Case_Rollups.flow-meta.xml | ||
|
||
@TestSetup | ||
static void setup() { | ||
upsert new RollupSettings__c(IsEnabled__c = true); | ||
Account acc = new Account(Name = 'InvocableDrivenRollupTests'); | ||
insert acc; | ||
} | ||
|
||
@isTest | ||
static void shouldRollupMultipleDMLStatementsWithinSingleTransaction() { | ||
Account acc = [SELECT Id FROM Account]; | ||
Account reparentAccount = new Account(Name = 'Reparent'); | ||
insert reparentAccount; | ||
|
||
Date today = System.today(); | ||
|
||
Case one = new Case(Amount__c = 1, AccountId = acc.Id, Description = 'distinct', Subject = 'One', DateField__c = today.addDays(-2)); | ||
Case two = new Case(Amount__c = 2, AccountId = acc.Id, Description = 'again', Subject = 'Two', DateField__c = today); | ||
Case three = new Case(Amount__c = 0, AccountId = reparentAccount.Id, Description = 'something else', Subject = 'Three'); | ||
Case four = new Case(Amount__c = 0, AccountId = reparentAccount.Id, Description = one.Description, Subject = 'Four'); | ||
|
||
Test.startTest(); | ||
insert new List<Case>{ one, two, three, four }; | ||
|
||
one.Amount__c = 2; | ||
one.AccountId = reparentAccount.Id; | ||
update one; | ||
|
||
// Trigger recursive update after reparenting | ||
// this is important because it not only validates that the recursion | ||
// detection is working properly, but also because it validates that the | ||
// recursion detection is necessary to calculate the results properly! | ||
one.Subject = 'Z'; | ||
update one; | ||
Test.stopTest(); | ||
|
||
acc = [SELECT Id, Description, AnnualRevenue, Name, NumberOfEmployees, DateField__c FROM Account WHERE Id = :acc.Id]; | ||
reparentAccount = [SELECT Id, Description, AnnualRevenue, Name, NumberOfEmployees, DateField__c FROM Account WHERE Id = :reparentAccount.Id]; | ||
|
||
System.assertEquals(today, acc.DateField__c, 'LAST should have been updated to new last'); | ||
System.assertEquals(2, acc.AnnualRevenue, 'First account sum field should be decremented on reparent'); | ||
System.assertEquals(two.Description, acc.Description, 'CONCAT_DISTINCT should remove extra text on reparent'); | ||
System.assertEquals(1, acc.NumberOfEmployees); | ||
System.assertEquals(two.Subject, acc.Name); | ||
|
||
System.assertEquals(today.addDays(-2), reparentAccount.DateField__c); | ||
System.assertEquals(3, reparentAccount.NumberOfEmployees, 'Second account should properly reflect reparented record for number of employees'); | ||
System.assertEquals(one.Description + ', ' + three.Description, reparentAccount.Description, 'Second account should have only reparented case description'); | ||
System.assertEquals(one.Subject, reparentAccount.Name, 'Second account name field should reflect last subject'); | ||
System.assertEquals(2, reparentAccount.AnnualRevenue, 'Second account sum field should include updated amount'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"> | ||
<apiVersion>52.0</apiVersion> | ||
<status>Active</status> | ||
</ApexClass> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.