Skip to content

[Shopify] Migrate test mocking from IsTestInProgress to HttpClientHandler#7204

Draft
onbuyuka wants to merge 5 commits intomainfrom
private/onbuyuka/shpfytestmock
Draft

[Shopify] Migrate test mocking from IsTestInProgress to HttpClientHandler#7204
onbuyuka wants to merge 5 commits intomainfrom
private/onbuyuka/shpfytestmock

Conversation

@onbuyuka
Copy link
Contributor

@onbuyuka onbuyuka commented Mar 17, 2026

Summary

  • Remove the legacy IsTestInProgress event-based mocking infrastructure from the Shopify Connector
  • Migrate all tests to use the framework-level [HttpClientHandler] pattern with TestHttpRequestPolicy = BlockOutboundRequests
  • Delete ShpfyCommunicationEvents codeunit and 15 legacy subscriber codeunits
  • Net reduction of ~1,057 lines of code

Production code changes

  • Remove IsTestInProgress / SetTestInProgress / GetTestInProgress from ShpfyCommunicationMgt and all if IsTestInProgress branches
  • Delete ShpfyCommunicationEvents.Codeunit.al (5 legacy test-only events)
  • Remove GetTestInProgress() early-exit guards from 5 order/fulfillment codeunits
  • Remove IsTestInProgress parameter from OnBeforeUploadImage event
  • Add InputSize > 0 guard in InventoryAPI.ExportStock to skip empty mutations

Test code changes

  • Migrate ~40 test codeunits to [HttpClientHandler] with Library - Variable Storage for response queue routing
  • Delete 15 legacy subscriber codeunits; strip 2 others to non-HTTP business events only
  • Standardize initialization: CreateShop() + RegisterAccessTokenForShop()

Test plan

  • Shopify Connector app compiles
  • Shopify Connector Test app compiles
  • All Shopify Connector tests pass (4 remaining failures in SyncVariantImages and InventoryExport need investigation)

Fixes AB#625871

🤖 Generated with Claude Code

…ientHandler

Remove the legacy IsTestInProgress event-based mocking infrastructure from
the Shopify Connector and migrate all tests to use the framework-level
HttpClientHandler pattern.

Production code changes:
- Remove IsTestInProgress/SetTestInProgress/GetTestInProgress from
  ShpfyCommunicationMgt and all if-branches that routed HTTP to events
- Delete ShpfyCommunicationEvents codeunit (5 legacy test events)
- Remove GetTestInProgress early-exit guards from 5 order/fulfillment codeunits
- Remove IsTestInProgress parameter from OnBeforeUploadImage event
- Add InputSize > 0 guard in InventoryAPI.ExportStock

Test code changes:
- Migrate ~40 test codeunits to TestHttpRequestPolicy = BlockOutboundRequests
  with [HttpClientHandler] procedures and [HandlerFunctions] annotations
- Delete 15 legacy subscriber codeunits; strip 2 others to non-HTTP events only
- Use Library - Variable Storage for response queue routing in handlers
- Standardize initialization: CreateShop + RegisterAccessTokenForShop

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@github-actions github-actions bot added the AL: Apps (W1) Add-on apps for W1 label Mar 17, 2026
@github-actions github-actions bot added this to the Version 29.0 milestone Mar 17, 2026
- Remove 35 local Shop variable declarations that shadow codeunit-level Shop
- Rename Shop parameters to ShopParam to avoid AA0244
- Convert bare StrSubstNo format strings to Label constants (AA0217)
- Fix unassigned DefaultVariantId variable (AA0205)
- Remove unused ProductId variables (AA0206)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@onbuyuka onbuyuka force-pushed the private/onbuyuka/shpfytestmock branch from a0927ba to 6ca6dcb Compare March 18, 2026 10:51
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