Skip to content

test(pipeline): add pipeline stage transition tests for mgw:run#263

Merged
snipcodeit merged 1 commit intomainfrom
issue/252-write-pipeline-stage-transition-tests-fo
Mar 6, 2026
Merged

test(pipeline): add pipeline stage transition tests for mgw:run#263
snipcodeit merged 1 commit intomainfrom
issue/252-write-pipeline-stage-transition-tests-fo

Conversation

@snipcodeit
Copy link
Owner

Summary

  • Adds test/pipeline-transitions.test.js with 28 vitest tests simulating a full mgw:run cycle via mock-github.cjs and mock-gsd-agent.cjs
  • Three test suites: happy-path (new→done), failure-mode (empty agent output→failed), failure-mode (blocking comment→blocked)
  • Fourth suite covers checkpoint pipeline_step progression (triage→plan→execute→verify→pr)

Closes #252

Milestone Context

Changes

  • test/pipeline-transitions.test.js — 28 vitest tests across 4 suites (310 lines)
  • lib/mock-github.cjs — GitHub API interceptor for tests (from phase 47)
  • lib/mock-gsd-agent.cjs — Fake Task() agent stubs for tests (from phase 47)
  • vitest.config.js — Vitest runner config targeting *.test.js files
  • test/setup.js — Vitest global setup
  • test/loadFixture.js — Fixture loader utility
  • test/checkpoint.test.js — Checkpoint tests from issue Write tests for checkpoint read/write and resume detection #251
  • test/fixtures/github/ — 16 GitHub API fixture JSON files
  • test/fixtures/agents/ — 5 agent output fixture JSON files
  • package.json — vitest devDependency + test/test:node scripts

Test Plan

  • npx vitest run test/pipeline-transitions.test.js — 28 tests pass, 0 failures
  • Happy-path suite: all 7 stage transitions new→triaged→planning→executing→verifying→pr-created→done
  • onTransition hooks fire at each stage, clearHooks() prevents re-fire
  • Failure-mode 1: mock-gsd-agent.setResponse('gsd-planner', '')failed state
  • Failure-mode 2: mock-github.setResponse('gh issue view', ...) with blocking comment → blocked state
  • Checkpoint suite: all 5 pipeline_steps advance correctly in isolated tmpdir
  • No live GitHub tokens or Claude API calls required
GSD Progress
Step Status
Plan
Execute
Verify

…ock agents

Adds test/pipeline-transitions.test.js with 28 vitest tests covering the full
mgw:run cycle simulation using mock-github.cjs and mock-gsd-agent.cjs.

Four test suites:
- happy-path: new → triaged → planning → executing → verifying → pr-created → done
- failure-mode (empty agent output): pipeline → failed, recovery paths validated
- failure-mode (blocking comment): mock gh CLI intercept, pipeline → blocked
- checkpoint progression: triage → plan → execute → verify → pr step tracking

Also adds supporting infrastructure from v6 milestone prior phases:
- lib/mock-github.cjs (from phase 47)
- lib/mock-gsd-agent.cjs (from phase 47)
- vitest.config.js + test/setup.js + test/loadFixture.js (from phase 49)
- test/fixtures/github/ and test/fixtures/agents/ fixture files
- test/checkpoint.test.js (from phase 48 issue #251)

Closes #252

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core Changes to core library

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Write pipeline stage transition tests for mgw:run via mock agents

1 participant