test(e2e): spawn the real CLI binary in tests, add smoke coverage#118
Conversation
Foundation for the second "honest follow-up" flagged in #115: replace the fully mocked `flows/cli-push-flow.test.ts` with tests that exercise the real binary. This PR ships the spawn-helper infrastructure plus six smoke tests; full push-flow e2e (which needs ccusage stubbing or a real local stack) is deferred to a follow-up. What's new: - packages/cli/__tests__/e2e/spawn.ts — helper that spawns `node dist/index.js` with a tmpdir HOME, controlled env, and captured stdout/stderr/exit. No mocks of fs, env, or fetch. - packages/cli/__tests__/e2e/cli-smoke.e2e.test.ts — six smoke cases: --help / -h alias / --version / -v alias / unknown-command exit / --version is a side-effect-free read. What this catches that in-process tests cannot: - Build-pipeline regressions (tsc emits broken JS, missing imports). - argv parsing breakage that doesn't surface when calling main() directly. - Real exit codes for help/version/error paths. - Real stdout output the user reads. Test count: 220 → 226. CI runs the e2e tests as part of the existing `bun run --cwd packages/cli test` step (no new step needed; the build step that runs before tests has always built dist/). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Warning Rate limit exceeded
To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
Why
Second "honest follow-up" flagged in #115:
This PR ships the infrastructure for spawning the real CLI binary in tests, plus a smoke-test exemplar. The full push-flow e2e (which exercises login → real API call → real DB row written) needs either ccusage stubbing infrastructure or a full local Next.js stack — that's tracked as a follow-up so we ship value incrementally rather than bundling everything into one ten-file PR.
What
What this catches that in-process tests cannot
Test plan
Out of scope (real follow-ups)
🤖 Generated with Claude Code