Create the live Copilot test file with five test cases that exercise CliProcess with backend: 'copilot' against the real Copilot CLI binary. Tests gate on binary availability and a dry-run authentication check. Copilot live tests are primarily for local validation — CI skips them gracefully when the binary is absent.
Requirements
- Create
src/__tests__/live/copilot.live.test.ts
beforeAll must: (1) check CliProcess('copilot').isAvailable(), (2) perform a minimal dry-run CliProcess('copilot').run() with a 30s timeout to verify authentication; if either check fails, skip the entire suite via describe.skipIf
- Use
collectLive() and assertEventStreamStructure() from Phase 1 helpers
- Implement five test cases:
- Golden path: call
assertEventStreamStructure() on collected events
- ReadyEvent session UUID: assert
ReadyEvent.sessionId matches UUID format
- Text content emitted: assert at least one
TextEvent with non-empty text
- Session resume: second run with
sessionId from first run; assert ReadyEvent.sessionId matches
- AbortSignal mid-run: abort after
ReadyEvent; assert final event is ErrorEvent { code: 'aborted' }
- No test must fail solely because the
copilot binary is absent from the runner
Design Guidance
Implements the 'Copilot Live Test Suite' section of the architecture design. The authentication gating via dry-run invocation, the five test cases, and the 'No per-token cost' rationale are documented in the architecture's component design for copilot.live.test.ts.
Acceptance Criteria
Dependencies
Phase 1, Phase 4
Create the live Copilot test file with five test cases that exercise
CliProcesswithbackend: 'copilot'against the real Copilot CLI binary. Tests gate on binary availability and a dry-run authentication check. Copilot live tests are primarily for local validation — CI skips them gracefully when the binary is absent.Requirements
src/__tests__/live/copilot.live.test.tsbeforeAllmust: (1) checkCliProcess('copilot').isAvailable(), (2) perform a minimal dry-runCliProcess('copilot').run()with a 30s timeout to verify authentication; if either check fails, skip the entire suite viadescribe.skipIfcollectLive()andassertEventStreamStructure()from Phase 1 helpersassertEventStreamStructure()on collected eventsReadyEvent.sessionIdmatches UUID formatTextEventwith non-emptytextsessionIdfrom first run; assertReadyEvent.sessionIdmatchesReadyEvent; assert final event isErrorEvent { code: 'aborted' }copilotbinary is absent from the runnerDesign Guidance
Implements the 'Copilot Live Test Suite' section of the architecture design. The authentication gating via dry-run invocation, the five test cases, and the 'No per-token cost' rationale are documented in the architecture's component design for
copilot.live.test.ts.Acceptance Criteria
npm run test:livewith nocopilotbinary in PATH shows Copilot live tests as skipped (not failed)copilotis present but not authenticatedassertEventStreamStructure()(ReadyEvent, TextEvent, DoneEvent; no errors; seq monotonic; sessionIds match)ErrorEvent { code: 'aborted' }Dependencies
Phase 1, Phase 4