Golden fixtures: capture real 2.x frames #3

Closed
opened 2026-08-19 06:49:19 +00:00 by yuris · 1 comment
Owner

Tier-2 testing from the project backbone: capture real server frames with websocat against v1.json.spacetimedb, store as test/fixtures/*.jsonl, assert decoder handles them.

  • Publish minimal test module to spacetime start
  • Capture InitialConnection, SubscribeApplied, TransactionUpdate, ReducerResult transcripts
  • Golden test: decode every fixture line
  • Document re-capture on server version bump

devshell already has websocat.

Tier-2 testing from the project backbone: capture real server frames with websocat against `v1.json.spacetimedb`, store as `test/fixtures/*.jsonl`, assert decoder handles them. - [ ] Publish minimal test module to `spacetime start` - [ ] Capture InitialConnection, SubscribeApplied, TransactionUpdate, ReducerResult transcripts - [ ] Golden test: decode every fixture line - [ ] Document re-capture on server version bump devshell already has websocat.
Author
Owner

Done in ee90548. Captured a real session from clockworklabs/spacetime:v2.8.2 into test/fixtures/session.jsonl (7 frames: IdentityToken, TransactionUpdate x3, InitialSubscription, SubscriptionError, OneOffQueryResponse).

test/test_fixtures.lua replays every frame through the decoder and cache, asserting end state. Re-capture instructions are in the README; a server bump now surfaces as a fixture diff instead of a runtime surprise.

Capture tooling: server/capture-fixtures.mjs drives a deterministic sequence over ws, so the fixture file is stable across runs.

Done in ee90548. Captured a real session from `clockworklabs/spacetime:v2.8.2` into `test/fixtures/session.jsonl` (7 frames: IdentityToken, TransactionUpdate x3, InitialSubscription, SubscriptionError, OneOffQueryResponse). `test/test_fixtures.lua` replays every frame through the decoder and cache, asserting end state. Re-capture instructions are in the README; a server bump now surfaces as a fixture diff instead of a runtime surprise. Capture tooling: `server/capture-fixtures.mjs` drives a deterministic sequence over `ws`, so the fixture file is stable across runs.
yuris closed this issue 2026-08-19 07:36:44 +00:00
Sign in to join this conversation.
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
yuris/spacetimedb-defold#3
No description provided.