mirror of
https://github.com/garrytan/gstack.git
synced 2026-11-19 06:34:43 +01:00
* Load the Capy crew skills only on Capy machines (GST-1833) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * Add changelog entry for Capy-only crew skills (GST-1833) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * Move the Capy-only crew tooling into crew/ and run its tests only when needed (GST-1833) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * Test that the Capy launch file puts crew/bin on PATH Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * Count any ~/.capy as a Capy machine, so a Mac running Capy keeps /captain Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * Fix the tests and fixtures that broke when crew tooling moved into crew/ Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * Plan every crew test when a pull request's merge-base can't be read Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * Add a test that checks each crew-only module left the root tree for crew/ Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * Run crew tests on pull requests that change bin/ commands or workflows they drive Review-Finding: p1/specialist-batched#1 reader=testing Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * Keep running every crew test on every pull request; the skip comes in a later change Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * Keep copied installs and older release bisects working after the crew/ move Setup now copies crew/lib into every host's runtime root beside bin and lib, so Windows installs (which copy instead of linking) can still start gstack-ship-receipt, gstack-pregate and the other commands that import it. The release bisect runs the train-gate script from wherever the checked-out commit has it, so a bisect over commits from before the move still gets a verdict. Review-Finding: p1/outside-voice#1 reader=outside-voice Review-Finding: p1/outside-voice#2 reader=outside-voice Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * Say in the changelog that Windows installs keep working after the crew/ move Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * Point the harness guide's merge-queue rows at crew/lib/ where those modules moved Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * Point the plain-title test at the wave module's new home in crew/ (GST-1833) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> --------- Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
44 lines
2.8 KiB
TypeScript
44 lines
2.8 KiB
TypeScript
/** CEO-23 replay logic on fixture inputs: misses, retired cases and the fallback-rate summary. */
|
|
import { describe, expect, test } from 'bun:test';
|
|
import { caseTouchesDiff, replayRun, summarize, type ReplayInput } from '../scripts/replay-pr-selection';
|
|
|
|
const input = (over: Partial<ReplayInput>): ReplayInput => ({ runId: 1, oldMode: 'full-fallback', oldCases: 90, changedFiles: [],
|
|
truncated: false, failedCases: [], packageVersionOnly: false, ...over });
|
|
|
|
describe('PR selection replay (CEO-23)', () => {
|
|
test('a durations-only push no longer falls back, and a failure unrelated to the diff is not a miss', () => {
|
|
const row = replayRun(input({ changedFiles: ['scripts/paid-test-durations.json'], failedCases: ['qa-only-no-fix'] }), ['qa-only-no-fix']);
|
|
expect(row.newMode).toBe('pr');
|
|
expect(row.misses).toEqual([]);
|
|
expect(row.dropped).toEqual(['qa-only-no-fix']);
|
|
expect(caseTouchesDiff('qa-only-no-fix', ['scripts/paid-test-durations.json'])).toBe(false);
|
|
});
|
|
|
|
test('a failed profile case whose dependency changed stays selected; retired cases are counted apart', () => {
|
|
const row = replayRun(input({ changedFiles: ['qa/SKILL.md.tmpl'], failedCases: ['qa-bootstrap', 'retired-case-x'] }), []);
|
|
expect(caseTouchesDiff('qa-bootstrap', ['qa/SKILL.md.tmpl'])).toBe(true);
|
|
expect(row.misses).toEqual([]);
|
|
expect(row.retiredFailures).toEqual(['retired-case-x']);
|
|
});
|
|
|
|
test('a failed gate case the PR profile defers is reported as a miss, never hidden', () => {
|
|
const row = replayRun(input({ changedFiles: ['qa-only/SKILL.md.tmpl'], failedCases: ['qa-only-no-fix'] }), []);
|
|
expect(row.newMode).toBe('pr');
|
|
expect(row.misses).toEqual(['qa-only-no-fix']);
|
|
});
|
|
|
|
test('the summary reports both fallback rates and lists every miss', () => {
|
|
const lines = summarize([
|
|
{ runId: 1, oldMode: 'full-fallback', newMode: 'pr', oldCases: 90, newCases: 3, dropped: [], misses: [], retiredFailures: [], truncated: false, changed: 4, vanished: 0 },
|
|
{ runId: 2, oldMode: 'full-fallback', newMode: 'full-fallback', oldCases: 90, newCases: 90, dropped: [], misses: ['x'], retiredFailures: ['y'], truncated: true, changed: 300, vanished: 2 },
|
|
]).join('\n');
|
|
expect(lines).toContain('full-fallback: 2 (100%) recorded -> 1 (50%) replayed');
|
|
expect(lines).toContain('MISSES (failed, depends on the diff, not selected now): 1 -> 2:x');
|
|
expect(lines).toContain("300-file limit: 1");
|
|
expect(lines).toContain('no longer exist: 1');
|
|
expect(lines).toContain('wave branches (diff >= 100 files): 1 push(es); full-fallback 1 recorded -> 1 (100%) replayed');
|
|
expect(lines).toContain('ordinary pushes (diff < 100 files): 1 push(es); full-fallback 1 recorded -> 0 (0%) replayed; dependents 0, pr 1; median selected gate cases 3');
|
|
expect(lines).toContain("missing from today's tree: 1");
|
|
});
|
|
});
|