mirror of
https://github.com/garrytan/gstack.git
synced 2026-09-01 19:00:40 +02:00
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:
co-authored by
Claude Fable 5
parent
1055561cae
commit
6ef8aaba65
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user