Skip to main content

Module test_utils

Module test_utils 

Source
Expand description

Schema fixtures and crash checkpoints for tests of the production database.

Structs§

Followed
A live query’s results as a test follows them: each in the order the query reports it, kept as the latest one seen.
TestAuthorship
Authorship of test writes, sealed and hashed with one fixed test key for every audience. It opens headers it sealed itself and checks no signature: the database checks roots and openings; sync checks signatures (D9).
WorkCounter
Injected counter; clones observe the same database, never other test databases.
WorkCounts
Local database work observed at its execution boundaries.

Enums§

WriteCheckpoint
Boundaries after a local write’s durable commit, for process-crash tests.

Functions§

followed_tables_sql
The SQL that makes each table the app’s local triggers may follow, as every store makes it, coven_sync_status and coven_retry_effect with their one row. An app’s test that runs its own schema on a connection it opened itself, outside any store, runs these first, so its triggers on them apply and fire as in a store. Nothing of coven’s writes the tables there: the test writes the rows coven would.
idle_writers
Writers for a test not about forgetting kept records: one other device that can still write but never lands a write, so every kept record stays (§16.7).
notes_migrations
The corresponding app migration sequence.
notes_tables
Declarations for a UUID-keyed notes table in the store audience.
path_text_sql
What coven_path_text returns for its argument, for an app’s test that registers the function on a connection it opened itself, outside any store: the body every store registers.
report_cost
One measured number, as a line scripts/perf.sh reads: COST metric=<name> value=<n> unit=<ms|ratio|count>. Lower is better in every unit. A character in metric outside letters, digits and _./- becomes _, so a label can be passed as it reads.
report_time
report_cost for a time, in milliseconds.
signer
Fixed member key used to authenticate fixture writes.
stage_plaintext
Stage a snapshot’s whole plaintext from input, one chunk at a time, as sync stages an opened body (§16.2).