Skip to content

test: exercise packaged MCP workflows end to end - #312

Open
Waishnav wants to merge 5 commits into
codex/test-cleanup-stackfrom
codex/mcp-e2e-stack
Open

test: exercise packaged MCP workflows end to end#312
Waishnav wants to merge 5 commits into
codex/test-cleanup-stackfrom
codex/mcp-e2e-stack

Conversation

@Waishnav

@Waishnav Waishnav commented Sep 6, 2026

Copy link
Copy Markdown
Owner

The existing tests can pass while the installed package, OAuth flow, HTTP transport, or persisted workspace state is broken. This adds a small suite that drives the installed CLI through public MCP requests and checks the resulting files, process output, worktree isolation, and restored reviews across a server restart.

Each scenario owns its server and temporary state; the suite shares one package installation. It replaces the package smoke script and runs on all three existing CI platforms, retaining server logs on failure. Focused lifecycle tests remain useful for failures that need controlled ordering. Live models and host-rendered widgets are outside this suite; ordinary file-tool symlink containment remains tracked separately in #264.

Stacked on #311. Review and merge that cleanup first; this PR targets its branch so the diff contains only the E2E layer.

Summary by CodeRabbit

  • New Features

    • Added comprehensive end-to-end testing for packaged MCP workflows across legacy and modern protocols.
    • Added coverage for workspace lifecycle, file operations, commands, authentication, restarts, and safety checks.
  • Documentation

    • Added testing guidance, supported scenarios, focused test instructions, and failure-log details.
    • Documented the new end-to-end test command in development resources.
  • Chores

    • Updated CI to run end-to-end tests and retain failure logs.
    • Added test-result files to ignore rules and expanded test type-checking.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@coderabbitai

coderabbitai Bot commented Sep 6, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Team

Run ID: 9736dd83-d1d2-4ab9-8942-da18b39ae5fb

📥 Commits

Reviewing files that changed from the base of the PR and between 204ec79 and 3d6090b.

📒 Files selected for processing (11)
  • .github/workflows/ci.yml
  • .gitignore
  • README.md
  • docs/development.md
  • docs/testing.md
  • package.json
  • test/e2e/fixture.ts
  • test/e2e/package.ts
  • test/e2e/workflows.test.ts
  • test/package-install-smoke.test.ts
  • test/tsconfig.json
💤 Files with no reviewable changes (1)
  • test/package-install-smoke.test.ts

Included review availability: Your plan provides up to 8 included reviews per hour; 5 remain after this review.


📝 Walkthrough

Walkthrough

The pull request adds packaged MCP end-to-end tests. The tests install the packed package, launch the installed CLI, exercise legacy and modern MCP workflows, retain failure logs, and document the testing strategy.

Changes

Packaged MCP E2E testing

Layer / File(s) Summary
Package installation and server fixture
test/e2e/package.ts, test/e2e/fixture.ts
The E2E harness packs and installs the repository, starts the installed server, performs OAuth authentication, supports both MCP protocols, and cleans up temporary resources.
MCP workflow coverage
test/e2e/workflows.test.ts
Tests cover workspace lifecycle operations, path containment, worktrees, tool surfaces, process ownership, authentication, and installed launchers.
Test command and CI wiring
package.json, test/tsconfig.json, .github/workflows/ci.yml, .gitignore
The project adds the test:e2e command, type-checks E2E tests, runs them in CI, uploads failure logs, and ignores test-results/.
Testing documentation
README.md, docs/development.md, docs/testing.md
Repository documentation describes the E2E command, packaged test flow, workflow coverage, log handling, limitations, and authoring guidance.

Estimated code review effort: 4 (Complex) | ~45 minutes

Merge Risk: ⚪ Minimal · up to 3d609

The packaged MCP test suite and CI integration are mergeable with no identified current risk.

Sequence Diagram(s)

sequenceDiagram
  participant CI
  participant PackageTest
  participant InstalledCLI
  participant MCPClient
  participant Workspace
  CI->>PackageTest: run pnpm test:e2e
  PackageTest->>PackageTest: pack and install repository
  PackageTest->>InstalledCLI: launch devspace.js serve
  MCPClient->>InstalledCLI: authenticate and call MCP tools
  InstalledCLI->>Workspace: read, patch, execute, and restore workspace state
  InstalledCLI-->>MCPClient: return MCP results
  PackageTest-->>CI: retain logs when tests fail
Loading

Poem

A rabbit packed the code with care
Then hopped through MCP everywhere
Legacy paths and modern streams
Chased workspace bugs through leafy dreams
Logs stayed safe when tests turned gray
And CI watched the burrowed way

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 7.69% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 13 functions across 3 files. (7 skipped: 7… Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the primary change: adding end-to-end tests for packaged MCP workflows.
Full details: Docstring Coverage

Explanation

Docstring coverage is 7.69% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 13 functions across 3 files. (7 skipped: 7 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/mcp-e2e-stack

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@greptile-apps

greptile-apps Bot commented Sep 6, 2026

Copy link
Copy Markdown

Greptile Summary

This PR replaces the narrow package-install smoke test with packaged, end-to-end MCP workflow coverage across the existing CI platform matrix.

  • Packs and installs the published artifact into a temporary consumer.
  • Exercises legacy and modern MCP requests, OAuth persistence, reviews, worktrees, filesystem containment, process isolation, and npm-generated launchers.
  • Adds isolated fixture lifecycle management, retained server logs, E2E typechecking, and testing documentation.
  • The packaged launcher coverage directly guards against previously observed divergence between source-checkout and published-package execution.

Confidence Score: 4/5

The test-suite changes appear safe to merge after the non-blocking CI action-pinning hardening is considered.

The packaged workflow, protocol, persistence, process, and launcher tests align with the underlying contracts; the only accepted concern is the mutable reference used by the new failure-log upload action.

Files Needing Attention: .github/workflows/ci.yml

Security Review

The new failure-log upload step references its GitHub Action through a mutable version tag. Pinning it to a full commit SHA would remove the added CI supply-chain drift risk.

Important Files Changed

Filename Overview
test/e2e/fixture.ts Creates isolated Git, configuration, OAuth, server, client, restart, logging, and teardown infrastructure for packaged MCP tests.
test/e2e/package.ts Packs the checkout and installs its artifact once into a temporary consumer for the E2E suite.
test/e2e/workflows.test.ts Exercises packaged workflows across both protocols, including persistence, containment, worktrees, process ownership, authentication, and launchers.
.github/workflows/ci.yml Runs the packaged E2E suite on all matrix platforms and uploads failure logs, but introduces a mutable action reference.
package.json Adds the E2E command, preserves the former package-test command as an alias, and includes E2E sources in typechecking.
docs/testing.md Documents the suite's workflow coverage, prerequisites, retained artifacts, exclusions, and test-authoring guidance.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  CI[CI matrix: Linux, macOS, Windows] --> E2E[pnpm test:e2e]
  E2E --> Pack[npm pack]
  Pack --> Build[prepack: pnpm build]
  Build --> Install[Temporary consumer install]
  Install --> Server[Installed devspace server]
  Server --> OAuth[OAuth registration and grants]
  Server --> Legacy[Legacy MCP SDK client]
  Server --> Modern[Modern HTTP MCP requests]
  Legacy --> Workflows[Workspace workflows]
  Modern --> Workflows
  Workflows --> State[Files, Git, SQLite, reviews and processes]
  Server --> Restart[Server restart]
  Restart --> State
  E2E --> Logs[test-results/e2e logs]
Loading

Reviews (1): Last reviewed commit: "test: run packaged MCP scenarios in plat..." | Re-trigger Greptile

Comment thread .github/workflows/ci.yml Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant