GRI-2009: fail-first acceptance tests for live rollout status (#160) #184

Merged
vivy merged 1 commit from test/GRI-2009-rollout-status-acceptance into dev 2026-11-14 07:01:57 +00:00
Member

Summary

Fail-first acceptance tests for the live rollout view (forge issue #160), written against Nyssa's design comment there, before implementation exists.

One test per state/transition she described:

  • an_unauthenticated_request_is_rejected — no session → 401
  • connecting_an_assigned_device_emits_pending
  • a_heartbeat_matching_the_assignment_emits_applied
  • disconnecting_emits_offline
  • reassigning_an_applied_device_emits_pending_again
  • accepting_a_transfer_emits_downloading_with_the_file_size
  • completing_a_transfer_leaves_the_downloading_state
  • a_repeated_heartbeat_with_no_change_emits_no_event
  • two_devices_transitions_carry_their_own_device_id

Self-skips without SIGNAGE_TEST_DATABASE_URL, same convention as #172/#174 and #161/#178.

Open question for Prismancer/Nyssa

The exact SSE envelope on GET /api/v1/devices/rollout-status/stream is not yet confirmed. This file assumes one JSON object per data: line:
{"device_id": "<uuid>", "status": "offline"|"applied"|"pending"|"downloading", "bytes_done": <u64>, "bytes_total": <u64>} (the last two only when status == "downloading"), using field names already established elsewhere (device_id, bytes_done/bytes_total). If the wire shape lands differently, only this file's JSON-reading helpers need to change — the state-transition assertions do not.

Test plan

  • cargo test --test rollout_status_acceptance_integration -- --include-ignored --test-threads=1 against a real Postgres: all 9 fail on current dev with 404 (the SSE route does not exist yet) — the expected fail-first result.
  • ./scripts/local-gates.sh --rust-only: clean (fmt, clippy -D warnings, cargo-deny, full workspace test suite).
## Summary Fail-first acceptance tests for the live rollout view (forge issue #160), written against Nyssa's design comment there, before implementation exists. One test per state/transition she described: - `an_unauthenticated_request_is_rejected` — no session → 401 - `connecting_an_assigned_device_emits_pending` - `a_heartbeat_matching_the_assignment_emits_applied` - `disconnecting_emits_offline` - `reassigning_an_applied_device_emits_pending_again` - `accepting_a_transfer_emits_downloading_with_the_file_size` - `completing_a_transfer_leaves_the_downloading_state` - `a_repeated_heartbeat_with_no_change_emits_no_event` - `two_devices_transitions_carry_their_own_device_id` Self-skips without `SIGNAGE_TEST_DATABASE_URL`, same convention as `#172`/`#174` and `#161`/`#178`. ## Open question for Prismancer/Nyssa The exact SSE envelope on `GET /api/v1/devices/rollout-status/stream` is not yet confirmed. This file assumes one JSON object per `data:` line: `{"device_id": "<uuid>", "status": "offline"|"applied"|"pending"|"downloading", "bytes_done": <u64>, "bytes_total": <u64>}` (the last two only when `status == "downloading"`), using field names already established elsewhere (`device_id`, `bytes_done`/`bytes_total`). If the wire shape lands differently, only this file's JSON-reading helpers need to change — the state-transition assertions do not. ## Test plan - [x] `cargo test --test rollout_status_acceptance_integration -- --include-ignored --test-threads=1` against a real Postgres: all 9 fail on current `dev` with `404` (the SSE route does not exist yet) — the expected fail-first result. - [x] `./scripts/local-gates.sh --rust-only`: clean (fmt, clippy -D warnings, cargo-deny, full workspace test suite).
GRI-2009: fail-first acceptance tests for live rollout status (#160)
Some checks failed
CI / cargo fmt (pull_request) Successful in 8s
CI / the pre-push hook (pull_request) Successful in 9s
CI / cargo deny (pull_request) Successful in 1m28s
CI / cargo deny advisories (pull_request) Failing after 1m41s
CI / cargo clippy (pull_request) Successful in 1m50s
CI / repository boundary (pull_request) Successful in 34s
CI / frontend-web (pull_request) Successful in 1m34s
CI / cargo test (pull_request) Successful in 3m14s
CI / Notify gate failed (pull_request) Has been skipped
CI / CI (pull_request) Successful in 15s
3c3cf9c89a
vivy merged commit 24e3c59b25 into dev 2026-11-14 07:01:57 +00:00
vivy deleted branch test/GRI-2009-rollout-status-acceptance 2026-11-14 07:01:57 +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!184
No description provided.