Skip to content

[Shopify] Re-enable and fix legacy pricing tests#8274

Open
onbuyuka wants to merge 4 commits into
mainfrom
bugs/621557-reenable-shopify-pricing-tests
Open

[Shopify] Re-enable and fix legacy pricing tests#8274
onbuyuka wants to merge 4 commits into
mainfrom
bugs/621557-reenable-shopify-pricing-tests

Conversation

@onbuyuka
Copy link
Copy Markdown
Contributor

@onbuyuka onbuyuka commented May 21, 2026

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 on OnIsExtendedPriceCalculationEnabled; it does not disable the SalesPrices feature key. On a tenant where that feature is already enabled (the default on bcinsider/Sandbox/29.0+), the call is a silent no-op:

  1. IsExtendedPriceCalculationEnabled() keeps returning true.
  2. PriceCalculationMgt.FindSetup skips its early-exit branch.
  3. The setup-table lookup picks the V16 handler.
  4. V16 ignores the legacy Sales Price / Sales Line Discount records the test creates.
  5. ComparePrice ends up at 0 and the Compare Price assertion 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 via LibraryPriceCalculation.SetupDefaultHandler. This forces FindSetup to return the V15 implementation regardless of the tenant's feature-key state, so the legacy data path is exercised reliably.

The two DisabledTests/*.json entries are removed and the three tests are re-enabled.

Verified:

  • Local dev BC (29.0.50580.0): all three tests pass.
  • CI on bcinsider/Sandbox/29.0.50533.0: all 24 Apps (W1) shards green (run 26285157420).

Fixes AB#621557

Fixes AB#621557

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions github-actions Bot added the AL: Apps (W1) Add-on apps for W1 label May 21, 2026
@github-actions github-actions Bot added this to the Version 29.0 milestone May 21, 2026
onbuyuka and others added 3 commits May 21, 2026 21:56
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>
@onbuyuka onbuyuka marked this pull request as ready for review May 22, 2026 15:01
@onbuyuka onbuyuka requested a review from a team as a code owner May 22, 2026 15:01
@onbuyuka onbuyuka changed the title [Shopify] Re-enable pricing tests to verify CI failure [Shopify] Re-enable and fix legacy pricing tests May 22, 2026
@onbuyuka onbuyuka enabled auto-merge (squash) May 22, 2026 15:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AL: Apps (W1) Add-on apps for W1

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant