feat: implement Phase 1 dynamic data decoupling for conformance tests#51
Merged
damaz91 merged 4 commits intoJul 17, 2026
Conversation
damaz91
self-requested a review
July 13, 2026 07:21
…rsal-Commerce-Protocol#56) Update hardcoded version expectations in conformance tests to match the updated server version 2026-04-08.
segiodongo
force-pushed
the
feat/dynamic-data-decoupling
branch
from
July 16, 2026 16:38
df2c1fa to
9c59e4f
Compare
- Replace FulfillmentDestinationCreateRequest instantiation with ShippingDestination to resolve TypeAliasType instantiation error. - Decouple new test fixtures and shipping locations from conformance_input.json to a new test_fixtures.json file. - Add --fixture_config flag to allow passing custom test fixtures. - Update README with instructions for the new flag.
damaz91
approved these changes
Jul 17, 2026
Update get_test_price() to treat both int and float major-unit inputs uniformly when converting to minor units.
carolinerg1
approved these changes
Jul 17, 2026
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.
Overview
This pull request introduces Phase 1 of dynamic data decoupling to the UCP conformance test suite. By enabling tests to dynamically parameterize test fixtures (
SKU, pricing, discount codes, and destination addresses) from localized configuration profiles, merchants and external node implementers can run the conformance suite against their own product catalog and fulfillment rules without modifying core test assertions.Key Changes
Dynamic Fixture Context (
integration_test_utils.py)DynamicFixtureContext(and aliasConfiguredFixtureContext) to load and query test fixture configuration fromconformance_input.json.get_test_sku(),get_test_price(),get_test_destination(),get_test_discount_code()) with graceful fallbacks to existing array lookups (items) and standard defaults.create_checkout_payload()to dynamically populate item ID, price, and destination properties viaDynamicFixtureContext.Fulfillment Flow Refactoring (
fulfillment_test.py)test_fulfillment_flowto construct testPostalAddressinstances usingself.fixture_ctx.get_test_destination(), eliminating hardcoded indexing into static CSV address rows.Decoupled Test Fixtures (
test_data/flower_shop/test_fixtures.json)conformance_input.jsoninto a separatetest_fixtures.jsonfile.--fixture_configflag (defaulting to the newtest_fixtures.json) to allow parameterizing tests with custom fixtures, while maintaining backward compatibility by falling back toconformance_input.jsonfor missing keys.Verification
samples/rest/python/server/server.py).ap2_test.py,binding_test.py,business_logic_test.py,card_credential_test.py,checkout_lifecycle_test.py,fulfillment_test.py,idempotency_test.py,invalid_input_test.py,order_test.py,protocol_test.py,simulation_url_security_test.py,validation_test.py, andwebhook_test.py) locally, with 100% of tests passing.ruff checkandruff format.