perf(tests): reuse CLI compilation for exported binding checks

Reuse the existing CLI compilation policy in the exported binding acceptance
matrix. Own and clean a fresh cache per file while preserving caller cache
and coverage choices, all 92 cases, and every live CLI/MCP request and oracle.

Fixes #4079

Co-authored-by: Kaoru0822 <208281322+kaoru0822-kitauji@users.noreply.github.com>
This commit is contained in:
YsopwnableandKaoru0822 authored and GitHub committed 2026-10-15 19:00:04 +08:00
1 parent f255899ee8
commit 55cef2566a
2 files changed
+50 -17

No files matched your search

+12 -5
View File
@@ -40,6 +40,17 @@ const parseJson = (stdout: string): unknown | undefined => {
}
};
/** Reuse CLI compilation without overriding caller-selected cache or coverage. */
export const cliCompileCacheEnvironment = (
environment: NodeJS.ProcessEnv | undefined,
compileCache?: string,
): NodeJS.ProcessEnv => ({
...(compileCache === undefined || environment?.NODE_V8_COVERAGE !== undefined
? {}
: { NODE_COMPILE_CACHE: compileCache }),
...environment,
});
/** Create a compiled CLI driver backed by the supplied process registry. */
export const createTestCli = (
processes: TestProcesses,
@@ -68,11 +79,7 @@ export const createTestCli = (
TMP: tmpdir(),
}
: {}),
...(compileCache === undefined ||
environment?.NODE_V8_COVERAGE !== undefined
? {}
: { NODE_COMPILE_CACHE: compileCache }),
...environment,
...cliCompileCacheEnvironment(environment, compileCache),
},
...(input === undefined ? {} : { input }),
...(timeoutMs === undefined ? {} : { timeoutMs }),