Title#
test(#246): add E2E coverage for quality gate and skip-quality-gate directive
Problem#
The pre-PR quality gate (#231) lacked integration test coverage for its core lifecycle: gating, override, and bypass scenarios.
Task / Link#
Closes #246
Changes#
- Add
test/quality-gate.e2e-spec.tswith four E2E scenarios using in-memory SQLite - Scenario 1: auto-directive task is gated at deliver phase;
invoke()never called - Scenario 2:
skip-quality-gatesets override, approve clears gate,invoke()called withQUALITY_GATE_OVERRIDE=1, override consumed after deliver starts - Scenario 3: quick-directive task passes through deliver ungated; no
QUALITY_GATE_OVERRIDEin env - Scenario 4:
skip-quality-gatefrom non-author actor is applied (authorization is implicit at the webhook layer)
Notes#
Authorization for /agent skip-quality-gate is enforced at the GitHub HMAC webhook verification layer, not in DirectiveService. A TODO references #231 for potential future actor-based authorization.
Testing#
- All four E2E scenarios pass via
npm run test:e2e -- test/quality-gate.e2e-spec.ts - No existing unit tests broken (
npm run test: 666 passed, 1 pre-existing failure in ws-gateway unrelated to this change) - Lint errors are pre-existing in unrelated files (
src/main.ts,src/ws-gateway/)