refactor: fold mock e2e tests into pnpm test and flatten e2e directory#114
refactor: fold mock e2e tests into pnpm test and flatten e2e directory#114
Conversation
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.
Summary of ChangesHello @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
Changelog
Activity
Using Gemini Code AssistThe 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
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 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
|
There was a problem hiding this comment.
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.
| | `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`) | |
There was a problem hiding this comment.
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).
| | `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`) | |
There was a problem hiding this comment.
Fixed in 014ae4e: updated to shared-e2e-tests.ts.
| const e2eRealTestFiles = walk(resolve(root, "src/e2e")) | ||
| .map(toRel) | ||
| .filter((f) => f.endsWith(".e2e.test.ts")); |
There was a problem hiding this comment.
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.
| const e2eRealFiles = walk(resolve(root, "src/e2e")) | ||
| .map(toRel) | ||
| .filter((f) => f.endsWith(".ts")); |
There was a problem hiding this comment.
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)
Summary
.e2e.test.ts→.integration.test.tsso they run underpnpm testsrc/test-utils/session-test-utils.tssrc/e2e/real/→src/e2e/— the directory is now exclusively for real-backend testingtest:e2e:real:claude→test:e2e:claude, etc.vitest.e2e.config.ts(no mock e2e tests remain)Net result: -1,254 lines,
src/e2e/is real-backend-only, all former mock e2e tests run underpnpm test.Test plan
pnpm typecheckpassespnpm test— 182 files, 2686 tests pass (includes all moved integration tests)pnpm test:e2e:parity:checkpassespnpm check:archpasses🤖 Generated with Claude Code