mirror of
https://github.com/morluto/rea.git
synced 2026-11-10 08:47:00 +00:00
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:
1 parent
f255899ee8
commit
55cef2566a
2 files changed
+50
-17
No files matched your search
@@ -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 }),
|
||||
|
||||
Reference in new issue
Block a user