In-memory MasterKeyCustody for tests, with a switch to force persist
to fail. The switch models a device whose keyring is momentarily
unwritable, so a test can drive a key adoption into its failure path and then
clear the switch to prove the retry converges. Stores the serialized form
(like the real Keyring preset), so stored_key reflects exactly what a
caller wrote.
Grants a Dropbox shared-folder membership to whichever peer account asks —
the provider-side step a cross-principal admission needs before the joining
device can write to the store’s namespace.
Why a test pull did not produce a result. Keeps the three steps a test pull
runs — opening the store, authorizing the writer, running the cycle — apart,
so a test asserting on one of them cannot pass on another.
The synthetic store’s schema and Database constructors, which the database
layer owns and its own tests open directly.
Create the synthetic test schema on a connection. Run as the host migration
step for open_test_db (see test_migrations).
The synthetic store’s schema and Database constructors, which the database
layer owns and its own tests open directly.
Open a Database over a fresh in-memory connection with the synthetic test
schema and the test_synced_tables synced set.
The synthetic store’s schema and Database constructors, which the database
layer owns and its own tests open directly.
Like open_test_db but with an explicit synced set and migration ladder, for
tests that exercise a different schema (gate tests).
The synthetic store’s schema and Database constructors, which the database
layer owns and its own tests open directly.
Open a test Database over the synthetic schema with note_photos declared
blob-bearing per decl.
The synthetic store’s schema and Database constructors, which the database
layer owns and its own tests open directly.
Open a test Database over the synthetic schema with a caller-supplied
register clock (so a test can control the wall clock), plus an extra seed
step run after the host schema is created to plant host rows before
Database::open reads its floor.
The synthetic store’s schema and Database constructors, which the database
layer owns and its own tests open directly.
Open a test Database with both note_photos (per photo_decl) and
note_covers (per cover_decl) declared blob-bearing — the schema for the
per-provenance transition tests.
The synthetic store’s schema and Database constructors, which the database
layer owns and its own tests open directly.
The host-provided, eagerly-cached photo blob declaration most blob tests use.
The synthetic store’s schema and Database constructors, which the database
layer owns and its own tests open directly.
Open a read-test Database whose note_photos child carries a blob in
namespace, so read_blob’s locality dispatch can resolve a
blob in that namespace up to its gated notes root. The decl’s namespace MUST
match the blobs the test reads (the read path resolves the carrying table from the
blob’s namespace); its provenance/fill don’t matter to that resolution (the read
reads the row → root → gate, and takes provenance off the BlobRef), so this fixes
them. Pair with Database::plant_blob_row_for_test.
The synthetic store’s schema and Database constructors, which the database
layer owns and its own tests open directly.
Like read_test_db but with a chosen max_concurrent_downloads, so a pin test
can drive the download loop concurrently. Uploads run one at a time (not exercised here).
The synthetic store’s schema and Database constructors, which the database
layer owns and its own tests open directly.
The notes schema with a remote-root parent, carrying decl on note_photos.
The synthetic store’s schema and Database constructors, which the database
layer owns and its own tests open directly.
The Store view of a test database. Every sync test builds one; naming it here
keeps the three test modules that used to declare it from drifting apart.
The synthetic store’s schema and Database constructors, which the database
layer owns and its own tests open directly.
The synthetic test schema as a single-migration ladder, so a test db opens at
schema_version() == 1. The host-schema ladder for every open_test_db*
helper.
The synthetic store’s schema and Database constructors, which the database
layer owns and its own tests open directly.
Construct an isolated Store directory for a test composition root.
The synthetic store’s schema and Database constructors, which the database
layer owns and its own tests open directly.
The synthetic, domain-free schema the sync tests run against. Three synced
tables exercising the engine’s generic mechanics: a gated root (notes,
gated by its shared boolean), a child with a foreign key (note_tags,
which inherits the gate and exercises FK-violation retry), and a child that
CAN carry a blob (note_photos, also FK-to-notes, so it inherits the gate).
note_photos carries no blob here; blob tests declare one with
test_synced_tables_with_blob.
The synthetic store’s schema and Database constructors, which the database
layer owns and its own tests open directly.
test_synced_tables_with_blob with an ungated notes root: the rows are
remote from the start rather than waiting on a gate, which is what a snapshot
test needs to have something to publish before any gate is opened.
The synthetic store’s schema and Database constructors, which the database
layer owns and its own tests open directly.
test_synced_tables with note_photos declared blob-bearing per decl, for
tests exercising the blob push/pull/backfill paths. The blob id defaults to the
note_photos primary key; note_photos.cloud_path holds a readable key for
plain-scheme tests, and note_photos.blob_id is there for a decl that names a
blob id apart from the PK — the shape a row repointed at a new blob needs, since
the row keeps its primary key.
The synthetic store’s schema and Database constructors, which the database
layer owns and its own tests open directly.
test_synced_tables with TWO blob-bearing children of the gated notes root:
note_photos per photo_decl (a release file, user-provided) and note_covers
per cover_decl (a host-provided asset). Both inherit the notes gate, so a
make_remote of a note carries both — the user-provided file through the durable
outbox and the host-provided cover through the inline push — exercising the
per-provenance split in one subtree.