mirror of
https://github.com/garrytan/gstack.git
synced 2026-10-31 22:14:25 +01:00
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:
1 parent
9b718196b9
commit
586f7d458a
1 file changed
+3
-1
@@ -5,6 +5,7 @@
|
||||
* headings, and runners for bin/gstack-ship-budget and bin/gstack-review-log.
|
||||
*/
|
||||
import { spawnSync } from 'node:child_process';
|
||||
import { bunIsolationArgs } from '../../lib/bun-isolation';
|
||||
import * as fs from 'node:fs';
|
||||
import * as os from 'node:os';
|
||||
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');
|
||||
git('commit', '-qam', 'change');
|
||||
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 ?? '' };
|
||||
};
|
||||
let records = 0;
|
||||
|
||||
Reference in new issue
Block a user