refactor(test): first runBin migration batch (3 of ~36 run() duplicates)

explain-level-config, benchmark-cli, evidence move onto the shared
helper; each file's remaining special-case spawnSync sites (raw-buffer
probes, env-scrub probes) stay put deliberately. 55/55 green.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Garry Tan
2026-08-29 05:31:02 +00:00
co-authored by Claude Fable 5
parent 1055561cae
commit 6ef8aaba65
3 changed files with 15 additions and 25 deletions
+3 -5
View File
@@ -11,20 +11,18 @@ let gstackHome: string;
let repoDir: string;
import { gitIn, findFilesBySuffix } from './helpers/scratch-repo';
import { runBin } from './helpers/run-bin';
function git(args: string) {
gitIn(repoDir, args);
}
function run(args: string[], opts: { cwd?: string } = {}): { status: number; stdout: string; stderr: string } {
const r = spawnSync(EVIDENCE, args, {
return runBin(EVIDENCE, args, {
cwd: opts.cwd ?? repoDir,
env: { ...process.env, GSTACK_HOME: gstackHome },
encoding: 'utf-8',
timeout: 60000,
env: { GSTACK_HOME: gstackHome },
maxBuffer: 16 * 1024 * 1024, // the truncation test streams 3MB through the wrapper
});
return { status: r.status ?? 1, stdout: r.stdout ?? '', stderr: r.stderr ?? '' };
}
function ledgerFile(): string {