mirror of
https://github.com/garrytan/gstack.git
synced 2026-05-05 05:05:08 +02:00
fix: triage E2E runs both test files in subprocesses
math.test.js called process.exit(1) which killed the runner before string.test.js could execute. Changed test runner to use child_process so each test runs independently and both failure classes are exercised. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
+12
-3
@@ -2982,10 +2982,19 @@ try {
|
||||
}
|
||||
`);
|
||||
|
||||
// Test runner
|
||||
// Test runner — each test in a subprocess so one failure doesn't kill the other
|
||||
fs.writeFileSync(path.join(triageDir, 'test', 'run.js'), `
|
||||
require('./math.test.js');
|
||||
require('./string.test.js');
|
||||
const { execSync } = require('child_process');
|
||||
const path = require('path');
|
||||
let failures = 0;
|
||||
for (const f of ['math.test.js', 'string.test.js']) {
|
||||
try {
|
||||
execSync('node ' + path.join(__dirname, f), { stdio: 'inherit' });
|
||||
} catch (e) {
|
||||
failures++;
|
||||
}
|
||||
}
|
||||
if (failures > 0) process.exit(1);
|
||||
`);
|
||||
|
||||
// Commit on main with the pre-existing bug
|
||||
|
||||
Reference in New Issue
Block a user