feat: add end-to-end integration tests with mock agent backend (#11) (#11)#28
Merged
feat: add end-to-end integration tests with mock agent backend (#11) (#11)#28
Conversation
This was referenced Feb 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds end-to-end integration tests for the full CADRE pipeline using a mock agent backend and mock platform provider, so there is no dependency on real GitHub credentials or network calls. A GitHub Actions workflow is also added so e2e tests run automatically on every push and pull request.
Closes #11
Changes
tests/e2e-pipeline.test.ts: New e2e test suite exercising the realIssueOrchestratorthrough four scenarios (happy path, retry, blocked task, resume) using an inlineE2ELauncherandMockPlatformProvider.CommitManageris mocked viavi.mockto avoid real git operations.tests/helpers/mock-agent-launcher.ts: ReusableMockAgentLauncherhelper with per-agent and per-task handler registration and configurable failure injection.tests/helpers/mock-platform-provider.ts: In-memoryMockPlatformProviderimplementing the fullPlatformProviderinterface without real credentials.tests/e2e-workflow.test.ts: Unit tests validating the GitHub Actions workflow YAML file contents (11 test cases)..github/workflows/e2e.yml: New workflow that triggers onpushandpull_request, installs withnpm ci, setsCADRE_E2E=1, and runsnpm run test:e2ewith a 10-minute timeout.Implementation Details
The e2e tests wire
IssueOrchestratorwith realCheckpointManagerand real filesystem I/O underos.tmpdir(), while replacing the two external boundaries (agent execution and platform API) with fast, deterministic in-process stubs. Each test creates a unique temp directory and cleans up inafterEach. TheE2ELauncherwrites synthetic Markdown outputs that match the schemasResultParserexpects, so all five orchestrator phases execute normally.Testing
result.success === true, 5 phases all pass,pr-content.mdwritten to diskcode-writerfails on first attempt fortask-001, succeeds on second →result.success === truemaxRetriesPerTask) → pipeline still returnsresult.success === true, blocked task visible in checkpoint statenpx vitest run tests/e2e-pipeline.test.ts)tests/e2e-workflow.test.ts)Integration Verification
tests/github-issues.test.ts(unrelated to this PR; that test expects the oldget_issueMCP tool name but the implementation was updated toissue_read)Notes
GitHubAPI > getIssue > should fetch issue details via MCP) pre-dates this PR's changes. It assertscallTool('get_issue', ...)but the implementation now callscallTool('issue_read', { method: 'get', ... }). Afix-surgeonresult file documenting the needed fix is included in the diff but the test file itself was not corrected in this PR to keep the change minimal.22in the workflow (no.nvmrcfound in the repo).Cadre Process Challenges
dryRun: trueto pause at phase 2, but it's unclear whetherIssueOrchestratoractually supports that semantics).MockAgentLauncherhelper and the inlineE2ELauncherclass duplicated some logic. The planner requested a separatetests/helpers/mock-agent-launcher.tsfile (task-001) and also a test that used its own inline launcher (task-003), which created confusion about which launcher the e2e tests should actually use.CommitManagerviavi.mockrequired knowing the exact module path at write time. Any path mismatch silently fails (the mock doesn't apply), which is hard to diagnose. A cleaner dependency-injection approach inIssueOrchestratorwould make this simpler.ResultParser.parseImplementationPlanexpects. Getting the heading format and dependency syntax right required iterating — minor deviations caused silent parse failures producing 0 tasks.fix-surgeonwas invoked to address the pre-existinggithub-issues.test.tsfailure. The fix-surgeon result file was committed to the worktree rather than automatically updating the test, which is an odd artifact.MockAgentLauncherhelper (task-001) vs. the inlineE2ELauncherin the test file itself (task-003), and the lack of a clear spec for whatResultParserexpects from synthetic plan output. Both caused multiple implementation iterations.Closes #11