Repository navigation
Conversation
- writing-test-specs.md: define CLOSE_CLIENT, which 464 lines of the corpus use but no doc defined (it was described only in the commit that added it). - writing-test-specs.md: add the objects/unit, objects/integration and objects/proxy Test ID categories that 339 objects Test IDs already use. - writing-test-specs.md: use `endpoint:` in the proxy test template, as proxy.md's create_proxy_session signature and every corpus call do, instead of `target: TargetConfig(...)`. - integration-testing.md: list objects_gc_test.md among the specs annotated with `## Protocol Variants`.
proxy.md declares `endpoint` as a required argument of create_proxy_session, and every other corpus call passes `endpoint: "nonprod:sandbox"`. The two calls in presence_reentry.md passed only `rules:`, leaving each SDK harness to guess a default.
…me Test 22 The RTN14h test replaced the first CONNECTED with a message whose connectionKey was "__PASSTHROUGH__". uts-proxy has no such placeholder: its replace action (v0.3.0 and main) sends the message verbatim, so the client always received that literal string. Use an explicit fake key, matching the other replace rules in this file, and say in a comment that the test only checks that the client attempts the resume. The test's assertions are unchanged.
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.
Summary
This PR fixes stale and inconsistent text in the existing UTS docs, and two proxy specs that don't match
proxy.md. These problems turned up while writing the translator-skill docs in #558.The PR is independent of that one and targets
main. It changes 4 files (+26 / −5) and adds no new tests or spec points.Changes
1. Define
CLOSE_CLIENT—uts/docs/writing-test-specs.md:661–672CLOSE_CLIENT(client)appears on 464 lines across 55 spec files. Until now its meaning was recorded only in the message of the commit that added it (3745335). This adds a short "Closing Clients (CLOSE_CLIENT)" subsection under Pseudocode Conventions. It says that:writing-derived-tests.md.Other undocumented pseudocode constructs (
AWAIT_ERROR,AWAIT UNTIL,IS SAME AS, …) are deliberately left out. Picking canonical spellings for them is for the spec owner to decide.2. Add the objects Test ID categories —
uts/docs/writing-test-specs.md:38The
categoryfield said "One of:" followed by the rest and realtime categories only. The corpus has 339 Test IDs underobjects/unit,objects/integrationandobjects/proxy, which follow the same<module>/<tier>convention. This adds those three categories to the list.3. Use
endpoint:in the proxy test template —uts/docs/writing-test-specs.md:346The "Proxy Test Structure" template called
create_proxy_session(target: TargetConfig(realtimeHost: …, restHost: …), …). That conflicts with the signature inproxy.md(create_proxy_session(endpoint: String, …)) and with every call in the corpus. The template now usesendpoint: "nonprod:sandbox", so spec authors who copy it get the documented form.4. List
objects_gc_test.mdunder Protocol Variants —uts/docs/integration-testing.md:305objects/integration/objects_gc_test.mdhas a## Protocol Variantssection (added in 61b5afd), but the "Annotated specs" list didn't include it. The list now matches all 13 annotated specs.5. Pass
endpointtocreate_proxy_session—uts/realtime/integration/proxy/presence_reentry.md:74–77, 197proxy.mddeclaresendpointas a required argument, but both calls in this spec passed onlyrules:, which left each SDK harness to invent a default. Both now passendpoint: "nonprod:sandbox", formatted like the other calls. All 43create_proxy_sessioncalls in the corpus now pass the same endpoint.6. Replace
__PASSTHROUGH__with a fixed fake key —uts/realtime/integration/proxy/connection_resume.md:782–785, 796, 798(Test 22, RTN14h; separate commit)The test's
replacerule setconnectionKey(top level and inconnectionDetails) to"__PASSTHROUGH__". Neitherproxy.mdnor uts-proxy defines any such placeholder. uts-proxy'sreplaceaction sends the message verbatim (ws_proxy.go,case "replace":dst.WriteMessage(…, rule.Action.Message), at v0.3.0 and onmain), so the client has always received that literal string. The name implied that the proxy preserves the server's real key, which could lead harness authors to build a substitution that doesn't exist.The key is now
"proxy-ttl-test-key", in the style of the file's other fake keys (proxy-injected-new-key,recovery-failed-new-key), with a comment explaining that the message is sent verbatim. Because the client always received a literal value, its behaviour is unchanged, and none of the test's assertions depend on the key.Needs acknowledgement
Item 6 (Test 22 in
connection_resume.md) needs an acknowledgement from the test's author. It assumes the intent was "any key; the resume is expected to fail server-side", as the test's prose and its assertionconnection.id != "proxy-ttl-test-id"suggest. If the intent was for the client to resume with the server's real key, uts-proxy would need a field-preservingreplace, documented inproxy.md, instead of this change. Item 6 is its own commit, so it can be dropped without affecting the rest.Not in this PR
rules:-only sessions,target:and__PASSTHROUGH__) can be simplified once this PR merges.AWAIT_STATEsubscribes, then checks;How verified
mainwithgit grep: 464CLOSE_CLIENTlines, 339 objects Test IDs, 13## Protocol Variantsfiles, and 43 of 43create_proxy_sessioncalls passingendpoint: "nonprod:sandbox"after the change. The uts-proxyreplacebehaviour was read at tagv0.3.0and onmain.git diff --checkis clean.editorconfig-checkershows no new errors on the changed files: the 3 indentation warnings inwriting-test-specs.mdexist onmainand moved down 12 lines. The repo lint (build/scripts/find-duplicate-spec-items) passes. The changed lines add no Markdown links, so no links or anchors are affected.