[Shopify] Re-enable and fix legacy pricing tests#8274
Open
onbuyuka wants to merge 4 commits into
Open
Conversation
Fixes AB#621557 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
PROBE_1: IsExtendedPriceCalculationEnabled() should be false after Disable PROBE_2: IsExtendedPriceCalculationEnabled() should still be false later PROBE_3: Discount should be applied (Price != InitPrice) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
… legacy pricing DisableExtendedPriceCalculation() only unbinds the override subscriber; it is a no-op on tenants where the SalesPrices feature key is already enabled (which is the default on bcinsider/Sandbox/29.0+). When that happens the dispatcher falls through to the Price Calculation Setup table and picks V16, which does not read Sales Price / Sales Line Discount. Following the pattern used in TestPriceCalculationV16, explicitly enable extended pricing then call SetupDefaultHandler with the V15 handler so the legacy data path is exercised regardless of tenant state. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The three Shopify pricing tests previously disabled under bug 621557 relied on
LibraryPriceCalculation.DisableExtendedPriceCalculation()to force the V15 (legacy) calculation path. That helper only unbinds the override subscriber onOnIsExtendedPriceCalculationEnabled; it does not disable theSalesPricesfeature key. On a tenant where that feature is already enabled (the default onbcinsider/Sandbox/29.0+), the call is a silent no-op:IsExtendedPriceCalculationEnabled()keeps returningtrue.PriceCalculationMgt.FindSetupskips its early-exit branch.Sales Price/Sales Line Discountrecords the test creates.ComparePriceends up at0and theCompare Priceassertion fails.This is what made the tests fail on every CI run, while passing on dev BC builds where the feature key is off by default.
Fix: follow the pattern used in
TestPriceCalculationV16-- explicitly enable extended pricing and then mark the V15 handler as the default viaLibraryPriceCalculation.SetupDefaultHandler. This forcesFindSetupto return the V15 implementation regardless of the tenant's feature-key state, so the legacy data path is exercised reliably.The two
DisabledTests/*.jsonentries are removed and the three tests are re-enabled.Verified:
29.0.50580.0): all three tests pass.bcinsider/Sandbox/29.0.50533.0: all 24 Apps (W1) shards green (run 26285157420).Fixes AB#621557