test(supabase): avatar suite on the sandbox, per-run sandbox passwords

pnpm db:sandbox avatar-e2e runs tests/e2e/avatar-flow.e2e.ts with the real
worker (default mode) on the throwaway stack; the suite now requires its
database container by name, makes both accounts per run and expedites only
its own purges. Throwaway sandbox accounts get random passwords per run.
This commit is contained in:
bchanot committed 2026-11-01 21:02:59 +01:00
1 parent 96b19e5a87
commit 2a84e3702e
8 files changed
+139 -79

No files matched your search

+3 -2
View File
@@ -6,7 +6,7 @@
* never through a command argument.
*/
import { execFile } from 'node:child_process'
import { randomUUID } from 'node:crypto'
import { randomBytes, randomUUID } from 'node:crypto'
const need = (name: string): string => {
const value = process.env[name]
@@ -25,7 +25,8 @@ export const stack = {
serviceKey: need('SANDBOX_SERVICE_KEY'),
}
const PG_PASSWORD = need('SANDBOX_PG_PASSWORD')
export const PASSWORD = 'Sandbox-only-pw-1'
/** The password of the accounts a run creates: random per run, kept in memory only. */
export const PASSWORD = randomBytes(18).toString('base64url')
/** One psql session as postgres; resolves with stdout (tuples only) or rejects with stderr. */
export function sql(script: string): Promise<string> {