test: run ship-budget and review-log bins through their interpreters so Windows can launch them

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
This commit is contained in:
garrytanandcapy-ai[bot] committed 2026-10-29 07:36:26 +00:00
1 parent 9b718196b9
commit 586f7d458a
1 file changed
+3 -1
+3 -1
View File
@@ -5,6 +5,7 @@
* headings, and runners for bin/gstack-ship-budget and bin/gstack-review-log. * headings, and runners for bin/gstack-ship-budget and bin/gstack-review-log.
*/ */
import { spawnSync } from 'node:child_process'; import { spawnSync } from 'node:child_process';
import { bunIsolationArgs } from '../../lib/bun-isolation';
import * as fs from 'node:fs'; import * as fs from 'node:fs';
import * as os from 'node:os'; import * as os from 'node:os';
import * as path from 'node:path'; import * as path from 'node:path';
@@ -60,7 +61,8 @@ export function budgetHarness(): Harness {
fs.writeFileSync(path.join(repo, 'app.ts'), 'export const x = 2;\n'); fs.writeFileSync(path.join(repo, 'app.ts'), 'export const x = 2;\n');
git('commit', '-qam', 'change'); git('commit', '-qam', 'change');
const run = (bin: string, args: string[], extraEnv: NodeJS.ProcessEnv = {}): Run => { const run = (bin: string, args: string[], extraEnv: NodeJS.ProcessEnv = {}): Run => {
const r = spawnSync(bin, args, { cwd: repo, env: { ...env, ...extraEnv }, encoding: 'utf8', timeout: 60_000 }); const argv = bin === REVIEW_LOG_BIN ? ['bash', bin] : [process.execPath, ...bunIsolationArgs(), bin];
const r = spawnSync(argv[0], [...argv.slice(1), ...args], { cwd: repo, env: { ...env, ...extraEnv }, encoding: 'utf8', timeout: 60_000 });
return { code: r.status ?? -1, out: r.stdout ?? '', err: r.stderr ?? '' }; return { code: r.status ?? -1, out: r.stdout ?? '', err: r.stderr ?? '' };
}; };
let records = 0; let records = 0;