Skip to content

UTS: fix publish-body assertions and pin protocol per test - #537

Open
owenpearson wants to merge 1 commit into
mainfrom
fix/uts-publish-body-assertions
Open

owenpearson wants to merge 1 commit into
mainfrom
fix/uts-publish-body-assertions

Conversation

@owenpearson

Copy link
Copy Markdown
Member

Fixes the UTS test-spec defects in #527.

Defects fixed (contradictions with RSL4c3/RSL1k)

  • channel/publish.md RSL1a publish-message-array-1: object payload was asserted unstringified; now asserts a stringified data string, decodes it, and asserts encoding == "json" (matching the message_encoding.md idiom).
  • channel/publish.md RSL1e null-name-and-data-0: dropped the whole-body-equality against a literal that omits the idempotency id (RSL1k1); now asserts field-wise plus the existing NOT IN omission checks.
  • channel/idempotency.md RSL1k mixed-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

useBinaryProtocol defaults to true (TO3f), so parse_json(request.body) only holds under JSON. Added useBinaryProtocol: false to 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 pin useBinaryProtocol (citing message_encoding.md as the pattern).

Files changed

  • uts/docs/writing-test-specs.md
  • uts/rest/unit/channel/publish.md
  • uts/rest/unit/channel/idempotency.md
  • uts/rest/unit/channel/annotations.md
  • uts/rest/unit/channel/update_delete_message.md
  • uts/rest/unit/batch_publish.md (RSC22c6 pinned to JSON so the base64/encoding: "base64" branch is valid)
  • uts/rest/unit/push/push_admin_publish.md
  • uts/rest/unit/push/push_channels.md
  • uts/rest/unit/push/push_channel_subscriptions.md
  • uts/rest/unit/push/push_device_registrations.md

Merge order

PR 3 of 7. Merge after the mock-HTTP PR. Shares channel/idempotency.md with the spec-point-references PR and encoding/message_encoding.md with the broken-fixtures PR, so coordinate/rebase.

Closes #527

🤖 Generated with Claude Code

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

1 active deployment
staging/pull/537 a4a30392 Deployed Sep 21, 2026 by github-actions[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant