feat: refactor conformance suite into vertical-agnostic architecture (RFC #520) - #107
Open
segiodongo wants to merge 1 commit into
Open
segiodongo wants to merge 1 commit into
segiodongo wants to merge 1 commit into
Conversation
…(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.
segiodongo
force-pushed
the
feat/vertical-agnostic-conformance
branch
from
September 14, 2026 15:30
6273dd1 to
be7ecbb
Compare
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
Refactors the conformance suite from a flat, shopping-specific layout into a vertical-agnostic, tiered architecture, so that verticals beyond shopping can be certified without forking the framework (RFC #520).
This branch has been rebased onto the latest
mainand integratesmain's newer and rewritten tests into the new tier layout.Architecture
Tests are organised into tiers:
framework/core/common/shopping/Suites are selected declaratively via
SUITE_REGISTRYinrunner.pyand exposed through aucp-conformanceconsole script:Capability gating is now declarative. Tests annotate their requirements with
@requires_capability("dev.ucp.shopping.order")instead of hand-rolling a discovery probe insetUp, so a business that does not advertise a capability sees a skip rather than a failure.Integrating
main's testsThree of the four commits originally on this branch had already been squash-merged into
main, so only the refactor commit is replayed here.main's newer tests were moved into the tier layout:totals_test.pyshopping/checkout/totals_test.pyfulfillment_structure_test.pyshopping/fulfillment/structure_test.pywebhook_structure_test.pyshopping/order/webhook_structure_test.pydiscount_test.pyshopping/discount/semantics_test.pyprotocol_test.pycore/protocol_test.pyandshopping/checkout/protocol_test.pybusiness_logic_test.pyshopping/checkout/business_logic_test.py(discount cases moved to the discount tier)These appear as renames rather than deletions in the diff.
A note on one placement:
webhook_structure_test.pylanded undershopping/order/rather than a sharedcommon/webhooks/module. Although it exercises webhook delivery mechanics, every case drivescreate_checkout_session/complete_checkout_sessionand gates ondev.ucp.shopping.order, so it is not vertical-agnostic in its current form. The genuinely shared webhook assertions live incommon/webhooks/.integration_test_utils.pyis retained as a thin deprecation facade that re-exports the relocated symbols, so any out-of-tree tests importing it continue to work.SDK compatibility
Several model types moved from
ucp_sdk.models.schemas.shoppingtoucp_sdk.models.common.typesbetween SDK 0.4.6 and 0.5.0. Imports for the affected types are now wrapped in atry/except ImportErrorfallback, so the suite imports and runs cleanly against both. Onmainthe suite cannot currently be collected under 0.5.0.CI workflow
Two changes to
.github/workflows/conformance-tests.yml:for test_file in *_test.pyglob loop is replaced by a singleuv run ucp-conformance --suite=allinvocation.--platform=googleis replaced with--conformance_input=shopping/fixtures/flower_shop/conformance_input.json.On (2): enforcing a single vendor's certification profile in the upstream repository's own CI would cause unrelated PRs to fail whenever that profile's mandates move ahead of the reference server. Running against the reference server's own declared conformance input keeps the signal attributable to the change under review. Vendor profiles remain fully supported via
--platformfor downstream certification runs.Verification
Run against the reference server under the exact CI configuration (python-sdk
v2026-04-08-6, samples atmain):main(baseline)Both branches fail the same two tests —
order_test.py::test_order_fulfillment_retrievalandorder_test.py::test_order_update— with a500fromPUT /checkout-sessions/{id}. These are pre-existing onmainand are not introduced by this PR.pre-commit run --all-filespasses.PR description covering the tier architecture, how main's tests were remapped, SDK compatibility shims, CI changes with rationale, and a verification table showing no regressions.