mirror of
https://github.com/garrytan/gstack.git
synced 2026-11-19 22:54:36 +01:00
Merge remote-tracking branch 'origin/main' into cso-requalification-shebang
# Conflicts: # CHANGELOG.md
This commit is contained in:
commit
85cb55efb9
6 files changed
+76
-4
No files matched your search
@@ -14,6 +14,7 @@ import {
|
||||
runFreeShard,
|
||||
FreeRunReporter,
|
||||
buildRunEpilogue,
|
||||
failureExcerpt,
|
||||
FREE_TEST_TIMEOUT_MS,
|
||||
DEFAULT_WALL_TIMEOUT_MS,
|
||||
PER_FILE_WALL_MS,
|
||||
@@ -272,6 +273,12 @@ describe('test-free-shards: exclusive host-state phase', () => {
|
||||
expect(counts).toEqual(mode === 'retry-reader' ? [2, 1, 1] : mode === 'retry-exclusive' ? [1, 1, 2] : [1, 1, 1]);
|
||||
if (mode.startsWith('retry-')) {
|
||||
expect(output).toContain('FLAKY-PASS');
|
||||
expect(output).toContain(' Expected: 2');
|
||||
const [flake] = fs.readFileSync(path.join(directory, 'flakes.jsonl'), 'utf8').trim().split('\n').map(line => JSON.parse(line));
|
||||
expect(flake.file).toBe(selected[mode === 'retry-reader' ? 0 : 2]);
|
||||
expect(flake.tests).toHaveLength(1);
|
||||
expect(flake.tests[0].name).toBe('selected fixture');
|
||||
expect(flake.tests[0].excerpt.slice(0, 3)).toEqual(['error: expect(received).toBe(expected)', 'Expected: 2', 'Received: 1']);
|
||||
expect(events[6]).toEqual({ file: selected[mode === 'retry-reader' ? 0 : 2], event: 'start' });
|
||||
} else if (mode === 'truncated-exclusive') {
|
||||
expect(output).toContain('flaky-retry skipped');
|
||||
@@ -826,6 +833,38 @@ describe('test-free-shards: output contract (log capture, quiet console, failure
|
||||
expect(lines.some((l) => l.includes('2 planned file(s) produced no output'))).toBe(true);
|
||||
});
|
||||
|
||||
// Windows run 39448730953 attempt 1, windows-free-shard (6): the team-init PowerShell case as bun printed it.
|
||||
test('a failure keeps the assertion bun printed before its (fail) line, and the epilogue shows it', () => {
|
||||
const reporter = new FreeRunReporter(['test/team-init-hook-shell-neutral.test.ts']);
|
||||
reporter.write([
|
||||
'::group::test\\team-init-hook-shell-neutral.test.ts:',
|
||||
'(pass) required team hook: shell-neutral registration > through the default shell: deny with exit 2 when no install resolves, {} when one does [211.85ms]',
|
||||
'killed 1 dangling process',
|
||||
'66 | const denied = runner(hookEnv({ HOME: home, USERPROFILE: home }));',
|
||||
'67 | expect(denied.status).toBe(denyStatus);',
|
||||
' ^',
|
||||
'error: expect(received).toBe(expected)',
|
||||
'',
|
||||
'Expected: 1',
|
||||
'Received: null',
|
||||
'',
|
||||
' at <anonymous> (D:\\a\\gstack\\gstack\\test\\team-init-hook-shell-neutral.test.ts:67:29)',
|
||||
'',
|
||||
'::error file=test\\team-init-hook-shell-neutral.test.ts,line=67,col=29,title=error: expect(received).toBe(expected)::Expected: 1',
|
||||
'(fail) required team hook: shell-neutral registration > through PowerShell: deny with exit 2 when no install resolves, {} when one does [30108.20ms]',
|
||||
' ^ this test timed out after 30000ms.',
|
||||
'',
|
||||
].join('\n'), 'stderr');
|
||||
reporter.end();
|
||||
const [failure] = reporter.report().failures;
|
||||
expect(failure.excerpt).toEqual(['error: expect(received).toBe(expected)', 'Expected: 1', 'Received: null',
|
||||
' at <anonymous> (D:\\a\\gstack\\gstack\\test\\team-init-hook-shell-neutral.test.ts:67:29)']);
|
||||
const lines = buildRunEpilogue('failed', reporter.report(), 30_000, '/tmp/x.log');
|
||||
expect(lines).toContain(' Received: null');
|
||||
expect(failureExcerpt(['noise', 'one', 'two', 'three'])).toEqual(['one', 'two', 'three']);
|
||||
expect(failureExcerpt(['error: x'.padEnd(300, 'y'), ...Array.from({ length: 10 }, (_, i) => 'line ' + i)])).toHaveLength(8);
|
||||
});
|
||||
|
||||
test('duplicate fail lines dedupe; pre-header failures are labeled unattributed', () => {
|
||||
const reporter = new FreeRunReporter(['test/a.test.ts']);
|
||||
reporter.write(`${failLine('early unattributed')}\n`, 'stderr');
|
||||
|
||||
Reference in new issue
Block a user