fix(test): stream large report snapshot SQL
Independent Staging Quality Gate / validate (push) Successful in 11m8s
Independent Staging Quality Gate / publish (push) Successful in 3m52s

Co-Authored-By: Claude Code <noreply@anthropic.com>
This commit is contained in:
jesse-ux
2026-09-23 18:51:08 +08:00
co-authored by Claude Code
parent 451a58089a
commit 018b2b4883
8 changed files with 148 additions and 6 deletions
@@ -17,6 +17,7 @@ export type PostgresFixture = {
connectionUrl(role: string, password: string): string;
psql(sql: string): string;
psqlAs(role: string, password: string, sql: string): string;
psqlScriptAs(role: string, password: string, sql: string): string;
stop(): void;
};
@@ -270,6 +271,37 @@ export function startPostgresFixture(): PostgresFixture {
{ encoding: "utf8", env: environment },
).trim();
},
psqlScriptAs(role, password, sql) {
return execFileSync(
"docker",
[
...composeArguments,
"exec",
"-T",
"-e",
`PGPASSWORD=${password}`,
"postgres",
"psql",
"-X",
"-At",
"-v",
"ON_ERROR_STOP=1",
"--single-transaction",
"-f",
"-",
"-U",
role,
"-d",
"jyotisha",
],
{
encoding: "utf8",
env: environment,
input: sql,
maxBuffer: 16 * 1024 * 1024,
},
).trim();
},
stop() {
try {
execFileSync(