/** * Where a MySQL installed on this machine listens unless it was configured otherwise. The same port * the containers use internally, but not the port they are mapped to on the host (see `buildPorts`). */ export declare const defaultLocalMysqlPort = 3306; /** * Environment variables that point the e2e tests at a MySQL that is already running on this * machine. Setting the port is what switches the mode: `stam test e2e` then skips its own MySQL * container. `--local-db` / `--no-local-db` override this per run. */ export declare const e2eMysqlPortVariable = "STAMHOOFD_E2E_MYSQL_PORT"; export declare const e2eMysqlUserVariable = "STAMHOOFD_E2E_MYSQL_USER"; export declare const e2eMysqlPasswordVariable = "STAMHOOFD_E2E_MYSQL_PASSWORD"; /** * The MySQL the e2e tests connect to. * * - `container`: `stam test e2e` starts a MySQL container of its own (namespaced per worktree, with * a data volume that persists between runs) and shuts it down afterwards. * - `local`: a MySQL that is already running on this machine, on `127.0.0.1:`. No container * is started or stopped, which saves the startup time and memory of a second MySQL server. */ export type E2eMysqlTarget = { kind: 'container'; } | { kind: 'local'; port: number; user: string; password: string; }; /** * Whether this run uses its own MySQL container or one that is already running. * * `localDb` is the `--local-db` flag: `true` forces a local MySQL, `false` forces the container, * and `undefined` (flag not passed) leaves the choice to the environment. */ export declare function resolveE2eMysqlTarget(options?: { localDb?: boolean; }): E2eMysqlTarget; /** * The databases of the Playwright workers are named `-`. The prefix reaches the * Playwright process through this variable, which is set by `stam test e2e`. */ export declare const playwrightDatabasePrefixVariable = "PLAYWRIGHT_DB_PREFIX"; export declare const playwrightDatabaseBaseName = "stamhoofd-playwright"; /** * Set by `stam test e2e --clear` when the run connects to a MySQL that keeps running afterwards: * there is no data volume to drop, so the Playwright global setup drops the worker databases of * this run before migrating them again. */ export declare const playwrightClearDatabasesVariable = "PLAYWRIGHT_CLEAR_DATABASES"; export declare function shouldClearPlaywrightDatabases(): boolean; /** * Credentials of the MySQL of this run, set by `stam test e2e` when they differ from the root/root * of the test environment. Passed under their own names because the test environment overwrites * `DB_USER`/`DB_PASS` in `process.env` with its own values whenever it is (re)loaded. */ export declare const playwrightDatabaseUserVariable = "PLAYWRIGHT_DB_USER"; export declare const playwrightDatabasePasswordVariable = "PLAYWRIGHT_DB_PASSWORD"; /** * The credentials to connect with, if this run was given any. Undefined values keep the default of * the test environment. */ export declare function playwrightDatabaseCredentials(): { user?: string; password?: string; }; /** * The prefix of the worker databases of this instance. Following the same convention as the * development database, the primary worktree keeps the historical bare name and every other * worktree appends its instance name, so a run never migrates the databases of a checkout that is * on another branch. */ export declare function buildPlaywrightDatabasePrefix(instance: { name: string; primary: boolean; }): string; /** * The database of one Playwright slot. Derived from the slot, not from the worker index: a run * reserves a block of slots that no other run on this machine uses, so runs started from several * worktrees never share a database, even when they all connect to the same MySQL server. */ export declare function playwrightDatabaseName(slot: number, prefix?: string): string; //# sourceMappingURL=test-database-config.d.ts.map