mirror of
https://github.com/garrytan/gstack.git
synced 2026-11-05 00:03:15 +01:00
test: explicit timeouts on the re-check and result-head CLI tests (each spawns several git and bun runs; the carry tests ran past bun's 5 s default locally)
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
This commit is contained in:
1 parent
955eb9ce96
commit
68f34a6def
2 files changed
+5
-5
No files matched your search
@@ -25,7 +25,7 @@ describe('GSTACK_RESULT head= token (GST-1179)', () => {
|
||||
expect(line).toBe(`GSTACK_RESULT: skill=ship status=complete head=${head} run=${out}`);
|
||||
expect(head).toMatch(/^[0-9a-f]{40}$/);
|
||||
expect(parseResult(r.out)).toEqual({ skill: 'ship', status: 'complete', head, run: out });
|
||||
});
|
||||
}, 30_000);
|
||||
|
||||
test('a line without head= still parses, with no head', () => {
|
||||
expect(parseResult('GSTACK_RESULT: skill=pregate status=complete run=.gstack/tmp/pregate.json')).toEqual({ skill: 'pregate', status: 'complete', run: '.gstack/tmp/pregate.json' });
|
||||
|
||||
@@ -105,7 +105,7 @@ describe('carry with a scoped re-check (CLI)', () => {
|
||||
commit({ 'src/app.ts': 'export const a = 4;\n' }, 'fix: a=4');
|
||||
const bad = runBin(repo, 'gstack-ship-receipt', ['carry', '--body', body, '--recheck', stale], env);
|
||||
expect([bad.status, bad.out.trim().split('\n')[0]]).toEqual([EXIT.refused, 'CARRY: refused (RECEIPT_CARRY_REFUSED)']);
|
||||
});
|
||||
}, 60_000);
|
||||
|
||||
test('a clean re-check cannot carry across a changed risk class', () => {
|
||||
const { repo, from, body, env, commit } = reviewed();
|
||||
@@ -120,7 +120,7 @@ describe('carry with a scoped re-check (CLI)', () => {
|
||||
expect(r.status).toBe(EXIT.refused);
|
||||
expect(r.err).toMatch(/risk class|review depth/);
|
||||
expect(before.risk ?? []).not.toContain('money');
|
||||
});
|
||||
}, 60_000);
|
||||
|
||||
test('a legacy receipt, more changed paths than the walk names, and moved base context print RECHECK: not eligible', () => {
|
||||
const legacy = reviewed();
|
||||
@@ -136,7 +136,7 @@ describe('carry with a scoped re-check (CLI)', () => {
|
||||
const bin = reviewed({ 'src/app.wasm': '\0asm\x01\0\0\0' });
|
||||
bin.commit({ 'src/app.wasm': '\0asm\x01\0\0\0' + 'x'.repeat(4096) + '\0' }, 'fix: new wasm');
|
||||
expect(runBin(bin.repo, 'gstack-ship-receipt', ['carry', '--body', bin.body], bin.env).err).toContain('RECHECK: not eligible (a changed product path is binary');
|
||||
});
|
||||
}, 90_000);
|
||||
|
||||
test('base context moved next to a reviewed hunk plus a product edit elsewhere is not eligible (red-team p1 repro)', () => {
|
||||
const lines = (n: number, edits: Record<number, string> = {}) => Array.from({ length: 10 }, (_, i) => edits[i + 1] ?? `line ${i + 1}`).join('\n') + '\n';
|
||||
@@ -162,5 +162,5 @@ describe('carry with a scoped re-check (CLI)', () => {
|
||||
const r = runBin(repo, 'gstack-ship-receipt', ['carry', '--body', body], env);
|
||||
expect(r.status).toBe(EXIT.refused);
|
||||
expect(r.err).toContain('RECHECK: not eligible (base context also moved');
|
||||
});
|
||||
}, 60_000);
|
||||
});
|
||||
Reference in new issue
Block a user