Skip to content

refactor: fold mock e2e tests into pnpm test and flatten e2e directory#114

Merged
teng-lin merged 5 commits intomainfrom
refactor/fold-mock-e2e-into-pnpm-test
Feb 22, 2026
Merged

refactor: fold mock e2e tests into pnpm test and flatten e2e directory#114
teng-lin merged 5 commits intomainfrom
refactor/fold-mock-e2e-into-pnpm-test

Conversation

@teng-lin
Copy link
Copy Markdown
Owner

Summary

  • Delete 6 redundant mock e2e tests already covered by unit/integration tests (capabilities-broadcast, consumer-edge-cases, daemon-server, encrypted-relay, http-api-sessions, slash-commands)
  • Move 7 unique mock e2e tests alongside the modules they test, renamed .e2e.test.ts.integration.test.ts so they run under pnpm test
  • Move shared test helper to src/test-utils/session-test-utils.ts
  • Flatten src/e2e/real/src/e2e/ — the directory is now exclusively for real-backend testing
  • Simplify script names: test:e2e:real:claudetest:e2e:claude, etc.
  • Delete vitest.e2e.config.ts (no mock e2e tests remain)
  • Update docs (CLAUDE.md, DEVELOPMENT.md) with smoke vs full rationale and updated paths
  • Update scripts (e2e-parity-gate, arch-check) with new file locations

Net result: -1,254 lines, src/e2e/ is real-backend-only, all former mock e2e tests run under pnpm test.

Test plan

  • pnpm typecheck passes
  • pnpm test — 182 files, 2686 tests pass (includes all moved integration tests)
  • pnpm test:e2e:parity:check passes
  • pnpm check:arch passes

🤖 Generated with Claude Code

Delete 6 redundant e2e tests already covered by unit/integration tests.
Move 7 unique e2e tests alongside the modules they test as
*.integration.test.ts files, so they run under `pnpm test`.
Relocate shared helper to src/test-utils/session-test-utils.ts.
Update imports in moved files and real e2e tests.
Update parity gate, CLAUDE.md, and DEVELOPMENT.md.
- Flatten src/e2e/real/ → src/e2e/ (all e2e tests are real-only now)
- Move src/e2e/helpers/e2e-profile.ts → src/e2e/e2e-profile.ts
- Rename scripts: test:e2e:real:* → test:e2e:* (e.g. pnpm test:e2e:claude)
- Remove test:e2e:mock, vitest.e2e.config.ts (no mock e2e tests remain)
- Remove legacy test:e2e:realcli:* aliases
- Update vitest.e2e.real.config.ts include path
- Update CLAUDE.md, DEVELOPMENT.md, e2e-parity-gate.mjs
Drop the "real" qualifier since src/e2e/ is now exclusively for
real-backend testing.
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @teng-lin, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly refactors the project's testing infrastructure by consolidating mock end-to-end tests into integration tests and streamlining the E2E test directory. The primary goal is to simplify the testing landscape, reduce redundancy, and improve the clarity of test categories, resulting in a more efficient and maintainable test suite.

Highlights

  • Test Consolidation: Six redundant mock e2e tests (capabilities-broadcast, consumer-edge-cases, daemon-server, encrypted-relay, http-api-sessions, slash-commands) were deleted as their coverage is now handled by unit/integration tests.
  • Test Relocation and Renaming: Seven unique mock e2e tests were moved to reside alongside their respective modules and renamed from .e2e.test.ts to .integration.test.ts, allowing them to run under pnpm test.
  • Test Helper Centralization: A shared test helper was moved to src/test-utils/session-test-utils.ts for better organization and reusability.
  • E2E Directory Simplification: The src/e2e/real/ directory was flattened to src/e2e/, making the src/e2e/ directory exclusively for real-backend testing.
  • Script Name Simplification: E2E script names were simplified, for example, test:e2e:real:claude is now test:e2e:claude.
  • Test Configuration Removal: The vitest.e2e.config.ts file was deleted as no mock e2e tests remain.
  • Documentation Updates: Documentation files (CLAUDE.md, DEVELOPMENT.md) were updated to reflect the new testing structure, including smoke vs. full rationale and updated paths.
  • Script Updates: Scripts like e2e-parity-gate and arch-check were updated to account for the new file locations and test structure.
Changelog
  • CLAUDE.md
    • Updated test commands and descriptions to reflect the new E2E test structure.
    • Removed references to 'E2E mock' tests.
    • Simplified E2E command names by removing the 'real:' prefix.
    • Adjusted file paths for single E2E test execution.
  • DEVELOPMENT.md
    • Revised the 'Testing' section to reflect the new three-tier test structure (Unit + Integration, E2E smoke, E2E full).
    • Removed the 'E2E mock' section and introduced a detailed 'Integration tests' section.
    • Added a 'Why smoke vs full?' section to explain the distinction between E2E test tiers.
    • Updated command examples and file paths to align with the new naming conventions and directory structure.
    • Modified the CI trigger table to reflect changes in test lanes.
  • package.json
    • Updated the default test:e2e script to run smoke tests instead of mock tests.
    • Removed test:e2e:mock from parity check scripts.
    • Changed test:all to use vitest.e2e.real.config.ts.
    • Renamed and simplified numerous test:e2e:real:* scripts to test:e2e:*.
    • Removed redundant test:e2e:realcli:* aliases.
  • scripts/arch-check.mjs
    • Updated file paths for E2E test files and real files to reflect the flattening of the src/e2e/real directory.
    • Adjusted paths for session-manager-setup.ts and session-coordinator-setup.ts.
  • scripts/e2e-parity-gate.mjs
    • Updated REQUIRED_SCRIPTS to reflect the new E2E command names.
    • Modified REQUIRED_TEST_FILES to include the new integration test paths and remove old mock E2E test paths.
  • src/core/bridge/permission-flow.integration.test.ts
    • Renamed from src/e2e/permission-flow.e2e.test.ts.
    • Updated import paths for test utilities.
  • src/core/consumer/presence-rbac.integration.test.ts
    • Renamed from src/e2e/presence-rbac.e2e.test.ts.
    • Updated import paths for test utilities.
  • src/core/coordinator/session-lifecycle.integration.test.ts
    • Renamed from src/e2e/session-lifecycle.e2e.test.ts.
    • Updated import paths for core modules and test utilities.
  • src/core/coordinator/session-status.integration.test.ts
    • Renamed from src/e2e/session-status.e2e.test.ts.
    • Updated import paths for test utilities.
  • src/core/coordinator/streaming-conversation.integration.test.ts
    • Renamed from src/e2e/streaming-conversation.e2e.test.ts.
    • Updated import paths for test utilities.
  • src/core/session/message-queue.integration.test.ts
    • Renamed from src/e2e/message-queue.e2e.test.ts.
    • Updated import paths for test utilities.
  • src/e2e/capabilities-broadcast.e2e.test.ts
    • Removed the file.
  • src/e2e/consumer-edge-cases.e2e.test.ts
    • Removed the file.
  • src/e2e/daemon-server.e2e.test.ts
    • Removed the file.
  • src/e2e/e2e-profile.ts
    • Renamed from src/e2e/helpers/e2e-profile.ts.
  • src/e2e/encrypted-relay.e2e.test.ts
    • Removed the file.
  • src/e2e/handshake.e2e.test.ts
    • Renamed from src/e2e/real/handshake.e2e.test.ts.
    • Updated import paths for test utilities and E2E profile.
  • src/e2e/helpers.ts
    • Renamed from src/e2e/real/helpers.ts.
    • Updated import paths for core modules and test utilities.
  • src/e2e/http-api-sessions.e2e.test.ts
    • Removed the file.
  • src/e2e/prereqs.ts
    • Renamed from src/e2e/real/prereqs.ts.
    • Updated import paths for utility functions.
  • src/e2e/process-smoke.e2e.test.ts
    • Renamed from src/e2e/real/process-smoke.e2e.test.ts.
    • Updated import paths for adapters and E2E profile.
  • src/e2e/session-coordinator-agent-sdk.e2e.test.ts
    • Renamed from src/e2e/real/session-coordinator-agent-sdk.e2e.test.ts.
    • Updated import paths for core modules and shared E2E tests.
  • src/e2e/session-coordinator-claude.e2e.test.ts
    • Renamed from src/e2e/real/session-coordinator-claude.e2e.test.ts.
    • Updated import paths for adapters, core modules, and shared E2E tests.
  • src/e2e/session-coordinator-codex.e2e.test.ts
    • Renamed from src/e2e/real/session-coordinator-codex.e2e.test.ts.
    • Updated import paths for core modules and shared E2E tests.
  • src/e2e/session-coordinator-gemini.e2e.test.ts
    • Renamed from src/e2e/real/session-coordinator-gemini.e2e.test.ts.
    • Updated import paths for core modules and shared E2E tests.
  • src/e2e/session-coordinator-opencode.e2e.test.ts
    • Renamed from src/e2e/real/session-coordinator-opencode.e2e.test.ts.
    • Updated import paths for core modules and shared E2E tests.
  • src/e2e/session-coordinator-setup.ts
    • Renamed from src/e2e/real/session-coordinator-setup.ts.
    • Updated import paths for adapters, core modules, and interfaces.
  • src/e2e/shared-e2e-tests.ts
    • Renamed from src/e2e/real/shared-real-e2e-tests.ts.
    • Updated import paths for core modules and interfaces.
  • src/e2e/slash-commands.e2e.test.ts
    • Removed the file.
  • src/e2e/smoke.e2e.test.ts
    • Renamed from src/e2e/real/smoke.e2e.test.ts.
    • Updated import paths for adapters and E2E profile.
  • src/server/ws-server-flow.integration.test.ts
    • Renamed from src/e2e/ws-server-flow.e2e.test.ts.
    • Updated import paths for server modules.
  • src/test-utils/session-test-utils.ts
    • Renamed from src/e2e/helpers/test-utils.ts.
    • Updated import paths for adapters, core modules, and E2E profile.
  • vitest.e2e.config.ts
    • Removed the file.
  • vitest.e2e.real.config.ts
    • Updated the include path to cover all E2E tests in src/e2e/.
Activity
  • The pull request author, teng-lin, created this pull request to refactor and flatten the e2e test directory and consolidate mock e2e tests into pnpm test.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request refactors the test suite by folding mock E2E tests into standard integration tests and flattening the src/e2e directory, which reduces complexity and improves the developer feedback loop. A security review found no vulnerabilities. However, there is a minor documentation mismatch and some script redundancies that need addressing.

Comment thread DEVELOPMENT.md Outdated
| `src/e2e/helpers.ts` | `attachTrace()`, `dumpTraceOnFailure()`, `getTrace()` |
| `src/e2e/session-coordinator-setup.ts` | `setupRealSession()` — coordinator with trace attached |
| `src/e2e/prereqs.ts` | Binary/auth detection, auto-skip logic |
| `src/e2e/shared-real-e2e-tests.ts` | Shared parameterised test factory (`registerSharedSmokeTests`, `registerSharedFullTests`) |
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The filename shared-real-e2e-tests.ts should be updated to shared-e2e-tests.ts to match the actual file rename performed in this PR (where the real- prefix was dropped).

Suggested change
| `src/e2e/shared-real-e2e-tests.ts` | Shared parameterised test factory (`registerSharedSmokeTests`, `registerSharedFullTests`) |
| `src/e2e/shared-e2e-tests.ts` | Shared parameterised test factory (`registerSharedSmokeTests`, `registerSharedFullTests`) |

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 014ae4e: updated to shared-e2e-tests.ts.

Comment thread scripts/arch-check.mjs Outdated
Comment on lines 299 to 301
const e2eRealTestFiles = walk(resolve(root, "src/e2e"))
.map(toRel)
.filter((f) => f.endsWith(".e2e.test.ts"));
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

With the flattening of the src/e2e directory, e2eRealTestFiles is now identical to e2eTestFiles (defined on line 302). These should be consolidated to avoid redundant filesystem walks and improve script maintainability.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 014ae4e: consolidated e2eRealTestFiles into e2eTestFiles and e2eRealFiles into e2eAllFiles (derived from existing sets). Removed the duplicate e2e_real_no_session_manager_import check.

Comment thread scripts/arch-check.mjs Outdated
Comment on lines 305 to 307
const e2eRealFiles = walk(resolve(root, "src/e2e"))
.map(toRel)
.filter((f) => f.endsWith(".ts"));
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The e2eRealFiles variable is now redundant as it effectively covers the same set of files as the union of e2eNonTestFiles and e2eTestFiles within the flattened src/e2e directory.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 014ae4e: replaced e2eRealFiles with e2eAllFiles = [...e2eNonTestFiles, ...e2eTestFiles] — no extra filesystem walk.

- Remove e2e-mock job (mock tests now run under pnpm test)
- Rename realcli script references to simplified names
- Move parity check into test job
- Fix stale shared-real-e2e-tests.ts reference in DEVELOPMENT.md
- Consolidate redundant e2eRealTestFiles/e2eRealFiles variables in
  arch-check now that src/e2e/ is flat
- Remove duplicate check (e2e_real_no_session_manager_import was
  identical to e2e_no_session_manager_import after consolidation)
@teng-lin teng-lin merged commit 5450296 into main Feb 22, 2026
6 checks passed
@teng-lin teng-lin deleted the refactor/fold-mock-e2e-into-pnpm-test branch February 22, 2026 18:40
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