perf(test): trim fixture and serialization overhead in integration suites

This commit is contained in:
Peter Steinberger
2026-03-03 01:08:52 +00:00
parent 588fbd5b68
commit d7bafae387
5 changed files with 70 additions and 114 deletions

View File

@@ -84,10 +84,11 @@ function runScript(
stdout: string;
stderr: string;
} {
const cacheKey = JSON.stringify({
homeDir,
extraEnv: Object.entries(extraEnv).toSorted(([a], [b]) => a.localeCompare(b)),
});
const extraEnvKey = Object.keys(extraEnv)
.toSorted((a, b) => a.localeCompare(b))
.map((key) => `${key}=${extraEnv[key] ?? ""}`)
.join("\u0001");
const cacheKey = `${homeDir}\u0000${extraEnvKey}`;
const cached = runScriptCache.get(cacheKey);
if (cached) {
return cached;