mirror of
https://github.com/garrytan/gstack.git
synced 2026-05-08 06:26:45 +02:00
test: add triage resolver unit tests, plan-eng coverage audit E2E, and triage E2E
- TEST_FAILURE_TRIAGE resolver: 6 unit tests verifying all triage steps (T1-T4), REPO_MODE branching, and safety default for ambiguous failures - plan-eng-coverage-audit E2E: tests /plan-eng-review coverage audit codepath (gap identified during eng review — existed on neither branch) - ship-triage E2E: planted-bug fixture with in-branch (truncate null) and pre-existing (divide-by-zero) failures; verifies correct classification - Touchfile entries for diff-based test selection Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -520,6 +520,46 @@ describe('TEST_COVERAGE_AUDIT placeholders', () => {
|
||||
});
|
||||
});
|
||||
|
||||
// --- {{TEST_FAILURE_TRIAGE}} resolver tests ---
|
||||
|
||||
describe('TEST_FAILURE_TRIAGE resolver', () => {
|
||||
const shipSkill = fs.readFileSync(path.join(ROOT, 'ship', 'SKILL.md'), 'utf-8');
|
||||
|
||||
test('contains all 4 triage steps', () => {
|
||||
expect(shipSkill).toContain('Step T1: Classify each failure');
|
||||
expect(shipSkill).toContain('Step T2: Handle in-branch failures');
|
||||
expect(shipSkill).toContain('Step T3: Handle pre-existing failures');
|
||||
expect(shipSkill).toContain('Step T4: Execute the chosen action');
|
||||
});
|
||||
|
||||
test('T1 includes classification criteria (in-branch vs pre-existing)', () => {
|
||||
expect(shipSkill).toContain('In-branch');
|
||||
expect(shipSkill).toContain('Likely pre-existing');
|
||||
expect(shipSkill).toContain('git diff origin/');
|
||||
});
|
||||
|
||||
test('T3 branches on REPO_MODE (solo vs collaborative)', () => {
|
||||
expect(shipSkill).toContain('REPO_MODE');
|
||||
expect(shipSkill).toContain('solo');
|
||||
expect(shipSkill).toContain('collaborative');
|
||||
});
|
||||
|
||||
test('solo mode offers fix-now, TODO, and skip options', () => {
|
||||
expect(shipSkill).toContain('Investigate and fix now');
|
||||
expect(shipSkill).toContain('Add as P0 TODO');
|
||||
expect(shipSkill).toContain('Skip');
|
||||
});
|
||||
|
||||
test('collaborative mode offers blame + assign option', () => {
|
||||
expect(shipSkill).toContain('Blame + assign GitHub issue');
|
||||
expect(shipSkill).toContain('gh issue create');
|
||||
});
|
||||
|
||||
test('defaults ambiguous failures to in-branch (safety)', () => {
|
||||
expect(shipSkill).toContain('When ambiguous, default to in-branch');
|
||||
});
|
||||
});
|
||||
|
||||
// --- {{SPEC_REVIEW_LOOP}} resolver tests ---
|
||||
|
||||
describe('SPEC_REVIEW_LOOP resolver', () => {
|
||||
|
||||
Reference in New Issue
Block a user