Skip to content

test: add fulfillment structural conformance module (title distinctness, single group per method) - #68

Merged
damaz91 merged 1 commit into
Universal-Commerce-Protocol:mainfrom
vishkaty:add-fulfillment-structure-tests
Jul 30, 2026
Merged

test: add fulfillment structural conformance module (title distinctness, single group per method)#68
damaz91 merged 1 commit into
Universal-Commerce-Protocol:mainfrom
vishkaty:add-fulfillment-structure-tests

Conversation

@vishkaty

Copy link
Copy Markdown
Contributor

Summary

Adds a small conformance module for two structural fulfillment invariants that the existing fulfillment_test.py (flows, address handling, geography-driven options, free shipping, totals roll-up) does not currently assert:

  • FUL-001 (fulfillment.md): an options[].title MUST distinguish the option from its siblings.
  • FUL-008 (fulfillment.md, default config): a Business MUST consolidate all items into a single group per method.

Tests

Both are server agnostic (they read the raw response.json() rather than a parsed SDK model), gate on dev.ucp.shopping.fulfillment, and skip honestly when the server emits no options or groups to assert on.

  • test_option_titles_distinguish_siblings: within each method group, every sibling option title is a non-empty string and is distinct within the group.
  • test_default_config_single_group_per_method: under the default configuration, each method returns exactly one group whose line_item_ids cover all of that method's items.

Scope

The module intentionally covers only requirements the reference flower shop server can exercise, and documents the exclusions in its docstring:

  • Option description non-repetition and available_methods[].description are not asserted because the reference emits neither field, so there is nothing to test.
  • Catalog pickup id matching is out of scope for a shipping only reference.
  • Grouping and per-method availability requirements that bind the consumer or platform rather than the responding Business are out of scope for a Business conformance suite.

Verification

Run against the reference flower shop server: both tests execute non vacuously (the server returns two distinct title options for a US destination, and consolidates a multi item cart into a single group per method). The full conformance suite stays green with no regressions.

Add fulfillment_structure_test.py covering two normative invariants from
the fulfillment extension spec (fulfillment.md) not asserted by the
existing fulfillment_test.py:

- FUL-001 (Rendering / options[].title "MUST distinguish this option from
  its siblings"): within a group, every option title is a non-empty string
  and distinct from its siblings.
- FUL-008 (Business Response Behavior, default supports_multi_group:
  "Business MUST consolidate all items into a single group per method"): a
  method covering several line items returns exactly one group covering all
  of them.

Assertions operate on the raw response.json() wire payload and are
server-agnostic. The module is capability-gated on
dev.ucp.shopping.fulfillment and skips honestly when the business emits no
options/groups to assert on.
@damaz91 damaz91 added status:needs-triage Signal that the PR is ready for human triage status:under-review and removed status:needs-triage Signal that the PR is ready for human triage labels Jul 28, 2026
@damaz91
damaz91 merged commit e37e48a into Universal-Commerce-Protocol:main Jul 30, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants