feat: refactor conformance suite into vertical-agnostic architecture (RFC #520) - #107
Open
segiodongo wants to merge 5 commits into
Open
Conversation
…rsal-Commerce-Protocol#56) Update hardcoded version expectations in conformance tests to match the updated server version 2026-04-08.
- 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.
Update get_test_price() to treat both int and float major-unit inputs uniformly when converting to minor units.
…(RFC #520) Restructure conformance test harness into a 4-tier architecture (framework, core, common, shopping) per RFC #520. - framework/: BaseIntegrationTest, dynamic mock servers, discovery profile parsing, and decorators (@requires_capability, @spec_assert). - core/: Protocol-level tests without retail domain dependencies (protocol discovery, binding, security, idempotency). - common/: Cross-cutting extensions (webhooks, AP2, card credentials). - shopping/: Retail domain tests (checkout lifecycle, business logic, discount, fulfillment, order, validation) and fixtures. - platforms/google.yaml: Platform certification profile verifying required capabilities and payment handlers. - runner.py: Dynamic CLI test orchestrator (ucp-conformance entrypoint) supporting suite filtering, platform evaluation, and capability checks. - integration_test_utils.py: Backward-compatible alias facade emitting DeprecationWarning.
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.
Summary of Changes
This PR refactors the UCP conformance test harness from a retail-only monolith into a modular, capability-driven, multi-vertical test architecture per UCP RFC #520.
Key Architectural Updates
4-Tier Separation of Concerns:
framework/: Agnostic test harness containingBaseIntegrationTest,UcpProfilediscovery parser, mock server harnesses (AgentProfileServer,MockWebhookServer), and decorators (@requires_capability,@spec_assert).core/: Protocol-level tests without retail domain dependencies (protocol discovery, HTTP bindings, simulation endpoint security, idempotency guarantees).common/: Cross-cutting protocol capabilities (webhooks, AP2, card credentials).shopping/: Retail domain tests (checkout/,discount/,fulfillment/,order/,validation/) and domain fixtures (shopping/fixtures/flower_shop/).Platform Certification Profiles:
platforms/google.yamlvalidating required capabilities (dev.ucp.shopping.checkout,order,fulfillment,discount) and payment handlers (com.google.pay) against the server discovery profile.Dynamic Test Runner CLI:
runner.pywithucp-conformanceentrypoint inpyproject.tomlsupporting--server_url,--suite [core|common|shopping|all],--platform <name>,-k <filter>, and--dry-run.Backward Compatibility:
integration_test_utils.pycompatibility facade that re-exports all base classes and fixtures withDeprecationWarning.test_data/flower_shopsymlink pointing to the new fixtures location.Verification
uv run ucp-conformance --suite=core: 12/12 passed (100%).uv run ucp-conformance --suite=common: 5/5 skipped as expected via capability filtering.uv run ucp-conformance --suite=shopping: 43/43 passed (100%).uv run ucp-conformance --platform=google --suite=all: 60 executed (55 passed, 5 skipped).PIP_INDEX_URL=https://pypi.org/simple/ uv tool run pre-commit run --all-files).ruffacross all 34 files.