test: harden HTTP scenario execution evidence

This commit is contained in:
DongHyeonka
2026-08-02 11:36:27 +09:00
parent e08d8c2dd8
commit d2eb320936
6 changed files with 143 additions and 28 deletions
+18 -4
View File
@@ -3,7 +3,7 @@ import type { SpawnSyncOptionsWithStringEncoding } from "node:child_process";
export const PNPM_SCRIPT_TIMEOUT_MS = 60_000;
export const PNPM_SCRIPT_MAX_OUTPUT_BYTES = 16 * 1024 * 1024;
type BoundedPnpmScriptInvocation = Readonly<{
type BoundedChildInvocation = Readonly<{
command: string;
arguments: readonly string[];
options: SpawnSyncOptionsWithStringEncoding;
@@ -20,11 +20,25 @@ export function createBoundedPnpmScriptInvocation(input: Readonly<{
pnpmCli: string;
script: string;
environment: NodeJS.ProcessEnv;
}>): BoundedPnpmScriptInvocation {
return Object.freeze({
}>): BoundedChildInvocation {
return createBoundedChildInvocation({
command: input.nodePath,
arguments: Object.freeze([input.pnpmCli, "run", input.script]),
arguments: [input.pnpmCli, "run", input.script],
environment: input.environment,
});
}
export function createBoundedChildInvocation(input: Readonly<{
command: string;
arguments: readonly string[];
environment: NodeJS.ProcessEnv;
cwd?: string;
}>): BoundedChildInvocation {
return Object.freeze({
command: input.command,
arguments: Object.freeze([...input.arguments]),
options: Object.freeze({
...(input.cwd === undefined ? {} : { cwd: input.cwd }),
encoding: "utf8",
env: input.environment,
killSignal: "SIGTERM",