test(perf): use shell resolver fixture in secrets audit

This commit is contained in:
Peter Steinberger
2026-03-02 14:10:45 +00:00
parent 1fe0f848df
commit f2468feb86

View File

@@ -139,16 +139,14 @@ describe("secrets audit", () => {
return; return;
} }
const execLogPath = path.join(fixture.rootDir, "exec-calls.log"); const execLogPath = path.join(fixture.rootDir, "exec-calls.log");
const execScriptPath = path.join(fixture.rootDir, "resolver.mjs"); const execScriptPath = path.join(fixture.rootDir, "resolver.sh");
await fs.writeFile( await fs.writeFile(
execScriptPath, execScriptPath,
[ [
`#!${process.execPath}`, "#!/bin/sh",
"import fs from 'node:fs';", `printf 'x\\n' >> ${JSON.stringify(execLogPath)}`,
"const req = JSON.parse(fs.readFileSync(0, 'utf8'));", "cat >/dev/null",
`fs.appendFileSync(${JSON.stringify(execLogPath)}, 'x\\n');`, 'printf \'{"protocolVersion":1,"values":{"providers/openai/apiKey":"value:providers/openai/apiKey","providers/moonshot/apiKey":"value:providers/moonshot/apiKey"}}\'',
"const values = Object.fromEntries((req.ids ?? []).map((id) => [id, `value:${id}`]));",
"process.stdout.write(JSON.stringify({ protocolVersion: 1, values }));",
].join("\n"), ].join("\n"),
{ encoding: "utf8", mode: 0o700 }, { encoding: "utf8", mode: 0o700 },
); );