Skip to content

Environment variables

Every process.env read in flaky-tests flows through a single resolveConfig() function in @flaky-tests/core. The variables below are the complete surface — nothing else is read anywhere in the codebase.

VariableDescriptionDefault
FLAKY_TESTS_LOGLog level: silent, error, warn, debugwarn
FLAKY_TESTS_LOG_FILEOptional path to append every log line to (in addition to the console sink). Useful when the console is crowded or Bun buffers stdout. Write failures are swallowed so a broken sink never crashes the logger.
FLAKY_TESTS_DISABLESet to 1 or true to turn the capture plugins into a no-op
FLAKY_TESTS_RUN_IDOverride the generated run id. Set automatically by @flaky-tests/plugin-bun/run-tracked when it spawns bun test — most users never set this manually.
FLAKY_TESTS_PROJECTExplicit project name used to isolate runs in shared stores. Set to an empty string to opt out and write rows with a NULL project.nearest package.json name, else cwd basename
VariableDescriptionDefault
FLAKY_TESTS_STOREWhich backend to use: sqlite, turso, supabase, postgres, or any custom type you’ve registered via definePlugin.sqlite
FLAKY_TESTS_STORE_MODULEExplicit module specifier for the dispatcher to import(). Overrides the @flaky-tests/store-<type> convention — use this for forks or third-party adapters that live under a different package name.
FLAKY_TESTS_DBSQLite database path (used only when FLAKY_TESTS_STORE=sqlite).node_modules/.cache/flaky-tests/failures.db
FLAKY_TESTS_CONNECTION_STRINGConnection string for the chosen remote store. libsql://… for Turso, postgres://… for Postgres, https://…supabase.co for Supabase.
FLAKY_TESTS_AUTH_TOKENAuth token for Turso (optional for local file DBs) or Supabase (anon / service role key).
VariableDescriptionDefault
FLAKY_TESTS_WINDOWDetection window length in days. Also settable via --window <n> on the CLI.7
FLAKY_TESTS_THRESHOLDMinimum recent failures required to flag a test as flaky. Also settable via --threshold <n> on the CLI.2
VariableDescriptionDefault
GITHUB_TOKENToken used to open issues when the CLI is invoked with --create-issue.
GITHUB_REPOSITORYowner/repo for issue creation. Set automatically inside GitHub Actions.
VariableDescriptionDefault
BROWSEROverride the command used to open the generated HTML report. Standard xdg convention.platform default

These are only read by getTestCredentials() in integration test files. They do not affect production runtime.

VariableDescription
INTEGRATIONSet to 1 to opt into integration-tier tests.
TURSO_TEST_URLlibSQL URL for the Turso integration suite.
POSTGRES_TEST_URLPostgres URL for the Postgres integration suite.
SUPABASE_TEST_URLSupabase project URL for the Supabase integration suite.
SUPABASE_TEST_KEYSupabase anon/service-role key for the Supabase integration suite.
FLAKY_TESTS_TURSO_LIVESet to 1 to opt into the store-turso live integration test against a real hosted Turso DB.
TURSO_LIVE_URLlibSQL URL of the throwaway DB used by the live Turso test.
TURSO_LIVE_TOKENAuth token for the throwaway DB used by the live Turso test.

When using the brewpirate/flaky-tests GitHub Action, inputs map to FLAKY_TESTS_* env vars automatically. See Action inputs for the mapping.

For the CLI: --flag > environment variable > default. For stores: options passed to the constructor > environment variable > default. If you pass dbPath to new SqliteStore({ dbPath: '...' }), that wins over FLAKY_TESTS_DB.