Repository navigation
test: assert ready_for_complete when nothing is outstanding - #117
Merged
carolinerg1 merged 1 commit intoNov 6, 2026
Merged
Conversation
A checkout with a buyer and a selected fulfillment option, carrying no error message and no Action, is completed by the business without further input. Nothing in the suite checked that the business reports ready_for_complete before that completion, so a server that never leaves incomplete passed every lifecycle test. The new test reads the status, completes the checkout to show nothing was outstanding, then asserts the status read beforehand.
This was referenced Oct 14, 2026
damaz91
approved these changes
Oct 30, 2026
damaz91
left a comment
Contributor
There was a problem hiding this comment.
LGTM — thank you for catching and closing this gap in checkout_lifecycle_test.py, @ken0nek!
Verifying that the checkout session has a selected fulfillment destination and option, no error messages, and no outstanding actions—and then proving empirically that POST /checkout-sessions/{id}/complete succeeds with no further input before asserting that the pre-completion status was ready_for_complete—is a very clean, self-contained way to test the readiness state transition in the Checkout specification.
The companion Node.js sample fix (Universal-Commerce-Protocol/samples#253) is also already in samples, and this merges cleanly with #111.
carolinerg1
approved these changes
Nov 6, 2026
carolinerg1
merged commit Nov 6, 2026
dda16ef
into
Universal-Commerce-Protocol:main
18 checks passed
vishkaty
added a commit
to vishkaty/conformance
that referenced
this pull request
Nov 10, 2026
Universal-Commerce-Protocol#120 replaced the CI loop over `*_test.py` with `ucp-conformance --suite=all`, which resolves through `SUITE_REGISTRY`. A module the registry does not name contributes no cases to that run, so this file would have merged and never executed: `--suite=all` resolved 77 cases on this branch with the module present and selected none of them. Main resolves 78; this head predates Universal-Commerce-Protocol#117. With the module registered the same command resolves 80 and selects its three cases. Removing the line again returns both to 77 and zero.
This was referenced Nov 13, 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.
Description
The suite never asserts
ready_for_complete. The string occurs once, invalidation_test.py, among the statuses a failed operation may leave behind. A server that never leavesincompletepasses all 11 tests incheckout_lifecycle_test.py, and the Node sample server is such a server.This change adds one test,
test_ready_for_complete_when_nothing_is_outstanding. It creates a checkout with a buyer, and the existing helper selects a fulfillment destination and option. The test reads the session with Get Checkout and checks that it has no error message and no Action. It then calls Complete Checkout and requirescompleted. Last, it asserts that the status it read before completion wasready_for_complete.The completion proves the premise. If the business places the order with no further input, nothing was outstanding when the test read the status, and the status should have said so.
test_complete_checkoutalready requires the same fixture to complete, so the only new demand on a server is the status.Results against samples
822431e:checkout_lifecycle_test.pyThe test does not cover the converse case. The Python sample server returns
ready_for_completeat create for a session with no fulfillment, and then refuses Complete Checkout on it. A second test would catch that, and it is not part of this change.Related: #111 lets other assertions in this file fail. It does not touch readiness. Both PRs add to the same file, so whichever lands second needs a rebase. Universal-Commerce-Protocol/ucp#949 raises the spec question.
Type of change
Is this a Breaking Change or Removal?
No. The change removes no schema file and no field.
Checklist