UTS: fix publish-body assertions and pin protocol per test - #537
Open
owenpearson wants to merge 1 commit into
Open
owenpearson wants to merge 1 commit into
owenpearson wants to merge 1 commit into
Conversation
Corrects three publish request-body assertions that contradicted RSL4c3/RSL1k, and makes rest/unit tests pin the protocol (JSON vs msgpack) they assume so that parse_json(request.body) assertions are only made where they hold. Closes #527 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This branch was successfully deployed
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.
Fixes the UTS test-spec defects in #527.
Defects fixed (contradictions with RSL4c3/RSL1k)
channel/publish.mdRSL1apublish-message-array-1: object payload was asserted unstringified; now asserts a stringifieddatastring, decodes it, and assertsencoding == "json"(matching themessage_encoding.mdidiom).channel/publish.mdRSL1enull-name-and-data-0: dropped the whole-body-equality against a literal that omits the idempotencyid(RSL1k1); now asserts field-wise plus the existingNOT INomission checks.channel/idempotency.mdRSL1kmixed-ids-in-batch-1: removed the assertion that a library id is generated for the id-less message in a mixed batch (RSL1k1's precondition excludes this; RSL1k3 forbids it); now asserts"id" NOT IN body[1]. Prose rewritten to state RSL1k3.Protocol pinned per test
useBinaryProtocoldefaults totrue(TO3f), soparse_json(request.body)only holds under JSON. AddeduseBinaryProtocol: falseto the client in every section that reads the request body, across the enumerated specs.Doc convention
Added a note to
docs/writing-test-specs.md: unit specs default to JSON when unpinned, and any spec whose assertions depend on the encoding must pinuseBinaryProtocol(citingmessage_encoding.mdas the pattern).Files changed
uts/docs/writing-test-specs.mduts/rest/unit/channel/publish.mduts/rest/unit/channel/idempotency.mduts/rest/unit/channel/annotations.mduts/rest/unit/channel/update_delete_message.mduts/rest/unit/batch_publish.md(RSC22c6 pinned to JSON so the base64/encoding: "base64"branch is valid)uts/rest/unit/push/push_admin_publish.mduts/rest/unit/push/push_channels.mduts/rest/unit/push/push_channel_subscriptions.mduts/rest/unit/push/push_device_registrations.mdMerge order
PR 3 of 7. Merge after the mock-HTTP PR. Shares
channel/idempotency.mdwith the spec-point-references PR andencoding/message_encoding.mdwith the broken-fixtures PR, so coordinate/rebase.Closes #527
🤖 Generated with Claude Code