Skip to content

feat: change checkout_lifecycle and business_logic test to better reflect business behaviour, update README#63

Merged
damaz91 merged 15 commits into
Universal-Commerce-Protocol:mainfrom
damaz91:feat/update-checkout-buyer-fulfillment
Jul 23, 2026
Merged

feat: change checkout_lifecycle and business_logic test to better reflect business behaviour, update README#63
damaz91 merged 15 commits into
Universal-Commerce-Protocol:mainfrom
damaz91:feat/update-checkout-buyer-fulfillment

Conversation

@damaz91

@damaz91 damaz91 commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Description

This PR updates the test_update_checkout in checkout_lifecycle_test.py to include buyer and fulfillment (with updated shipping destination) in the update request payload. It also asserts that the response contains the updated buyer details and the new selected destination.

Category (Required)

  • Core Protocol: Changes to the base communication layer, global context, or breaking refactors. (Requires Technical Council approval)
  • Governance/Contributing: Updates to GOVERNANCE.md, CONTRIBUTING.md, or CODEOWNERS. (Requires Governance Council approval)
  • Capability: New schemas (Discovery, Cart, etc.) or extensions. (Requires Maintainer approval)
  • Documentation: Updates to README, or documentations regarding schema or capabilities. (Requires Maintainer approval)
  • Infrastructure: CI/CD, Linters, or build scripts. (Requires DevOps Maintainer approval)
  • Maintenance: Version bumps, lockfile updates, or minor bug fixes. (Requires DevOps Maintainer approval)
  • SDK: Language-specific SDK updates and releases. (Requires DevOps Maintainer approval)
  • Samples / Conformance: Maintaining samples and the conformance suite. (Requires Maintainer approval)
  • UCP Schema: Changes to the ucp-schema tool (resolver, linter, validator). (Requires Maintainer approval)
  • Community Health (.github): Updates to templates, workflows, or org-level configs. (Requires DevOps Maintainer approval)

Related Issues

None.

Checklist

  • I have followed the Contributing Guide (including Conventional Commits title requirements and ! for breaking changes).
  • I have updated the documentation (if applicable).
  • My changes pass all local linting and formatting checks.
  • I have added tests that prove my fix is effective or that my feature works.
  • New and existing unit tests pass locally with my changes.
  • (For Core/Capability) I have included/updated the relevant JSON schemas.
  • I have regenerated Python Pydantic models by running generate_models.sh under python_sdk.

Screenshots / Logs (if applicable)

None.

damaz91 added 3 commits July 22, 2026 14:06
Updates the `test_update_checkout` in `checkout_lifecycle_test.py` to include `buyer` and `fulfillment` (with updated shipping destination) in the update request payload. Also asserts that the response contains the updated buyer details and the new selected destination.

TAG=agy
CONV=3ec5230d-ffcc-4f60-ae67-cf9d0f460020
Rewrites the README to focus on how to configure and run conformance tests against any custom UCP server implementation. Moves the Python sample server instructions to an example walkthrough section.

TAG=agy
CONV=3ec5230d-ffcc-4f60-ae67-cf9d0f460020
The `python-sdk` is already configured as an editable dependency in `conformance/pyproject.toml`, so `uv sync` in the `conformance` directory will automatically install it. Syncing it separately is redundant for running the tests.

TAG=agy
CONV=3ec5230d-ffcc-4f60-ae67-cf9d0f460020
@damaz91 damaz91 changed the title feat: include buyer and fulfillment address in update_checkout test feat: include buyer and fulfillment address in update_checkout test and update README Jul 22, 2026
@damaz91 damaz91 added the status:needs-triage Signal that the PR is ready for human triage label Jul 22, 2026
damaz91 added 7 commits July 22, 2026 14:21
Some servers (like ucp.business-store.dev) strictly require buyer details (email, name) to be present before a checkout can be completed. This updates the tests to pass a default buyer when creating sessions for completion tests. Also adds test data config for business-store.dev.

TAG=agy
CONV=3ec5230d-ffcc-4f60-ae67-cf9d0f460020
Reverts the addition of `test_data/business_store/` configuration files as they were intended for internal testing only. Keeps the generic buyer injection improvements in `checkout_lifecycle_test.py`.

TAG=agy
CONV=3ec5230d-ffcc-4f60-ae67-cf9d0f460020
…rence

Avoid using jane.doe@example.com in test_update_checkout, as it is used by other tests expecting no stored address, and the server persists addresses updated during checkout.

TAG=agy
CONV=23802bfc-a499-4064-b976-79aca6e847ef
…iscount codes

- Updates `assert_totals_consistent` helper to calculate expected totals dynamically, accounting for fulfillment, tax, and fee entries returned by the server (rather than assuming total == subtotal).
- Handles negative discount total values according to UCP schema.
- Replaces hardcoded discount codes in `business_logic_test.py` with dynamic lookup from the fixture context.
- Skips tests requiring fixed discounts or multiple discounts if not configured in the test fixtures.
- Updates flower shop `test_fixtures.json` to configure the correct discount codes and expected reductions.

TAG=agy
CONV=3ec5230d-ffcc-4f60-ae67-cf9d0f460020
Updates README.md to explain that `valid_discount_code_2` and `valid_fixed_discount_code` are optional in `test_fixtures.json` and that their respective tests will be skipped if they are not provided.

TAG=agy
CONV=3ec5230d-ffcc-4f60-ae67-cf9d0f460020
… conformance

- Updates `test_fixtures.json` to define discount percentages instead of absolute expected reductions.
- Updates conformance test helper to calculate expected percentage discount dynamically.
- Updates `test_multiple_discounts_accepted` to calculate both sequential and cumulative discount results, accepting either from the server.

TAG=agy
CONV=3ec5230d-ffcc-4f60-ae67-cf9d0f460020
- Fixes E501 (line too long) and formatting issues using ruff format.
- Adds missing docstring to `assert_totals_consistent` helper.
- Fixes D401 (imperative mood docstring) and wraps long lines in business_logic_test.py.

TAG=agy
CONV=3ec5230d-ffcc-4f60-ae67-cf9d0f460020
@damaz91 damaz91 changed the title feat: include buyer and fulfillment address in update_checkout test and update README feat: change checkout_lifecycle and business_logic test to better reflect business behaviour, update README Jul 22, 2026
@carolinerg1 carolinerg1 added status:under-review and removed status:needs-triage Signal that the PR is ready for human triage labels Jul 22, 2026
damaz91 added 4 commits July 22, 2026 17:16
TAG=agy
CONV=f0d818cd-0531-40ee-880f-865ddf2b2a5f
Aligns Markdownlint with Prettier to resolve CI conflict.
Removes duplicate root .markdownlint.json.

TAG=agy
CONV=f0d818cd-0531-40ee-880f-865ddf2b2a5f
Comment thread business_logic_test.py Outdated
Convert discount calculations from truncation (int()) to rounding (round()) to match standard business logic and avoid test failures when fixtures produce fractional cents.

TAG=agy

CONV=9f52b360-143c-4223-90ca-9a0e665c7c08
@damaz91
damaz91 merged commit a500ed6 into Universal-Commerce-Protocol:main Jul 23, 2026
15 checks passed
@damaz91
damaz91 deleted the feat/update-checkout-buyer-fulfillment branch July 23, 2026 13:35
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.

3 participants