mix ankusa.store.fixture (ankusa v0.7.0)

Copy Markdown View Source

Seeds an instance and packs its data directory as an upgrade fixture.

mix ankusa.store.fixture test/fixtures/store-v1.tar.zst

Run it at the release that introduces a store format and check the result in as test/fixtures/store-v<version>.tar.zst: test/ankusa/store_upgrade_test.exs boots current code on every fixture, so each later release has to read the stores this one wrote.

The seeded instance holds hooks still waiting on a sink (with their ingest dedupe keys), dead-lettered hooks, hooks that were delivered and archived (so only the archive catalogue and its segment know them), quarantined hooks and API-managed sources (one of them changed since, so it is at revision 2), a tenant's rate-limit override and the audit trail those changes wrote. The archive holds store/ (the RocksDB database), segments/ (the compacted objects) and manifest.json, the ids, revisions, audit rows and counts the upgrade test asserts after the boot. Compressed with zstd.

Summary

Functions

Seeds an instance in a scratch directory and writes the fixture archive to path. Returns the manifest packed beside the data.

Functions

build(path)

@spec build(Path.t()) :: map()

Seeds an instance in a scratch directory and writes the fixture archive to path. Returns the manifest packed beside the data.