Skip to content

tests: 1.5.5 recorded migration fixture, rows read back through migrate - #21

Merged
MattJackson merged 2 commits into
devfrom
lane-33-migration-fixture
Oct 14, 2026
Merged

MattJackson merged 2 commits into
devfrom
lane-33-migration-fixture

Conversation

@MattJackson

Copy link
Copy Markdown
Contributor

Closes the per-backend migration conformance gate of #33 (BUSBAR-1.6.0.md l.1096-1103, M5 l.1526): 1.5.x rows are proven against rows written by the pinned 1.5.5 binary and read back byte-identically; a missing fixture fails CI.

Fixture: store-sqlite/tests/fixtures/1.5.5/ was RECORDED by busbar scripts/store-migration-fixture.sh driving the published, digest-pinned busbar v1.5.5 binary over the published store-sqlite v1.0.6 plugin (two keys, one grouped with a day budget; models m-chat, m-cache with 4 cached tokens, m-chat-down refunded after a 503; 5 served requests, per_request_fee 3). Files unchanged: governance.db, rows.json, readback/*.json, MANIFEST.tsv (binary and plugin digests plus each file's sha256; store-migration-fixture.sh check passes).

Tests (src/tests.rs, beside the v6 fixture tests, which are untouched):

  • the_1_5_5_binarys_rows_read_back_through_migrate: opens a copy via SqliteStore::open and, parsing rows.json at test time, asserts every usage_metering cell (list_metering: key_id, model, provider, requests, billable_requests, key_group_at_use, pricing_version, four token columns; no extras), every usage_windows row (get_usage requests/billable and per-model tokens under UNIT_*), every key (group/name/enabled) and the audit chain (seq, prev_hash, hash).
  • migrate_over_the_1_5_5_rows_is_idempotent: open, drop, open again; reads identical and user_version == SCHEMA_VERSION both times.

Crash idempotence: the crate exposes no hook to stop migrate mid-way (it is one transaction), so it is covered by running migrate twice over the same file.

…libyaml via busbar-contract's serde_yaml_ng), as busbar-transport-http a6e29e3
@MattJackson
MattJackson merged commit fe39b69 into dev Oct 14, 2026
5 checks passed
@MattJackson
MattJackson deleted the lane-33-migration-fixture branch October 14, 2026 06:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant