GRI-1856: independent acceptance test for AC-5-06 (UpdateRequired) #109

Merged
vivy merged 1 commit from test/GRI-1856-handshake-protocol-version-acceptance into dev 2026-11-10 07:07:30 +00:00
Member

Independent acceptance test for AC-5-06 (plan/tests/mvp-acceptance.md section 5): "a protocol version the server refuses gets UpdateRequired, not a silent drop."

The behaviour already exists in ws::handle_socket (crates/server/src/ws.rs:94), but had no test anywhere — not in the implementer's own ws_integration.rs, not in crates/shared/src/protocol.rs's wire-format tests. The plan's original "For Step 2" note expected this row to live next to the handshake test in protocol.rs, but that file only round-trips serialisation; UpdateRequired is a live decision made against a real connection, so it needs this file's running-server-plus-real-PostgreSQL harness instead. Added to enrolment_acceptance_integration.rs, which already has that harness, with a module-doc note explaining the placement.

Test: ac_5_06_an_unsupported_protocol_version_gets_update_required_not_a_silent_drop — connects over a real WebSocket, sends a ClientHello with protocol_version: PROTOCOL_VERSION + 1, asserts the ServerHello outcome is UpdateRequired.

Fail-first, by temporarily changing the if hello.protocol_version != PROTOCOL_VERSION guard in ws.rs to if false:

SIGNAGE_TEST_DATABASE_URL=postgres://postgres:postgres@localhost:5432/postgres?sslmode=disable \
  cargo test -p server --test enrolment_acceptance_integration ac_5_06 -- --test-threads=1

thread 'ac_5_06_...' panicked:
assertion `left == right` failed: an unsupported protocol version must get UpdateRequired, not a silent drop
  left: Pending
 right: UpdateRequired
test result: FAILED. 0 passed; 1 failed

Reverted (agit diff on ws.rs clean against dev), reran the whole file:

test result: ok. 6 passed; 0 failed; 1 ignored (pre-existing AC-2-08 finding)

No production code changed. ./scripts/local-gates.sh passed in full.

Independent acceptance test for AC-5-06 (`plan/tests/mvp-acceptance.md` section 5): "a protocol version the server refuses gets `UpdateRequired`, not a silent drop." The behaviour already exists in `ws::handle_socket` (`crates/server/src/ws.rs:94`), but had no test anywhere — not in the implementer's own `ws_integration.rs`, not in `crates/shared/src/protocol.rs`'s wire-format tests. The plan's original "For Step 2" note expected this row to live next to the handshake test in `protocol.rs`, but that file only round-trips serialisation; `UpdateRequired` is a live decision made against a real connection, so it needs this file's running-server-plus-real-`PostgreSQL` harness instead. Added to `enrolment_acceptance_integration.rs`, which already has that harness, with a module-doc note explaining the placement. **Test:** `ac_5_06_an_unsupported_protocol_version_gets_update_required_not_a_silent_drop` — connects over a real `WebSocket`, sends a `ClientHello` with `protocol_version: PROTOCOL_VERSION + 1`, asserts the `ServerHello` outcome is `UpdateRequired`. **Fail-first**, by temporarily changing the `if hello.protocol_version != PROTOCOL_VERSION` guard in `ws.rs` to `if false`: ``` SIGNAGE_TEST_DATABASE_URL=postgres://postgres:postgres@localhost:5432/postgres?sslmode=disable \ cargo test -p server --test enrolment_acceptance_integration ac_5_06 -- --test-threads=1 thread 'ac_5_06_...' panicked: assertion `left == right` failed: an unsupported protocol version must get UpdateRequired, not a silent drop left: Pending right: UpdateRequired test result: FAILED. 0 passed; 1 failed ``` Reverted (`agit diff` on `ws.rs` clean against `dev`), reran the whole file: ``` test result: ok. 6 passed; 0 failed; 1 ignored (pre-existing AC-2-08 finding) ``` No production code changed. `./scripts/local-gates.sh` passed in full.
GRI-1856: independent acceptance test for AC-5-06 (UpdateRequired on unsupported protocol version)
Some checks failed
CI / the pre-push hook (pull_request) Successful in 9s
CI / cargo fmt (pull_request) Successful in 10s
CI / cargo deny (pull_request) Successful in 2m24s
CI / cargo deny advisories (pull_request) Failing after 2m44s
CI / cargo clippy (pull_request) Successful in 10m16s
CI / repository boundary (pull_request) Successful in 11s
CI / cargo test (pull_request) Successful in 11m29s
CI / frontend-web (pull_request) Successful in 10m2s
CI / Notify gate failed (pull_request) Has been skipped
CI / CI (pull_request) Successful in 4s
7d0ffabdbe
vivy merged commit afc5d956c0 into dev 2026-11-10 07:07:30 +00:00
vivy deleted branch test/GRI-1856-handshake-protocol-version-acceptance 2026-11-10 07:07:30 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
Grimoirix/grimoire-of-digital-signage!109
No description provided.