Documentation
¶
Overview ¶
Package storetest runs a test against every keysmith store backend that is available. Memory and sqlite always run. Postgres runs when KEYSMITH_TEST_PG_DSN is set and mongo when KEYSMITH_TEST_MONGO_URI is set; `make test-backends` sets both.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Name ¶
Name returns the backend name of the subtest t is running in: the last path element of the test name, such as "sqlite".
func OpenSQLite ¶
OpenSQLite opens an unmigrated sqlite store in a fresh temporary directory, with the DSN the store documents.
The engine's ValidateKey writes last_used_at from a goroutine nobody waits for, and on sqlite that write can still be waiting for the write lock when the test ends. If it outlives the cleanup it reopens the WAL files after the directory is emptied, and the temporary directory fails to remove. So the store this returns counts those writes, and the cleanup refuses new ones and waits for the rest before it closes the database.
Types ¶
This section is empty.