Skip to content

Retire per-package Vitest wiring for the root workspace - #104

Merged
soorya-u merged 4 commits into
mainfrom
issue-96-retire-per-package-test-wiring
Jul 22, 2026
Merged

Retire per-package Vitest wiring for the root workspace#104
soorya-u merged 4 commits into
mainfrom
issue-96-retire-per-package-test-wiring

Conversation

@soorya-u

@soorya-u soorya-u commented Jul 22, 2026

Copy link
Copy Markdown
Owner

Summary

  • Inline every package-local Vitest config into the root vitest.config.ts test.projects workspace and delete the superseded per-package configs.
  • Replace turbo's test:unit fan-out with a root script that runs the Vitest workspace directly (plus apps/cli's Bun suite); drop package test:unit scripts outside CLI.
  • Keep E2E scenarios and database integration as separate workspace projects, excluded from the unit command; update docs and the nightly WebRTC job for the new entry points.
  • Set up CLI temp repos in unit tests via es-git so nested git spawning cannot re-enter Lefthook under pre-push.

Closes #96

Test plan

  • bun run test:unit passes (Vitest workspace unit projects + @cyrus/cli Bun suite)
  • LEFTHOOK=1 bun run test:unit passes (pre-push nested-hook regression)
  • bun --filter @cyrus/database test:integration passes
  • bun run check / bun run check:syncpack clean
  • bun run check:knip clean aside from pre-existing e2e hints
  • Confirm CI test:unit job uses the new root script end to end (run 29905661072: bun test:unitvitest run --project … then @cyrus/cli Bun suite; 22 Vitest files + 91 CLI tests passed)

Consolidate every package-local Vitest config into root test.projects, drop turbo's test:unit fan-out, and make root test:unit run the workspace (plus apps/cli's Bun suite) directly.

Co-authored-by: Cursor <cursoragent@cursor.com>
@vercel

vercel Bot commented Jul 22, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
cyrus Ready Ready Preview, Comment Jul 22, 2026 9:22am

@coderabbitai

coderabbitai Bot commented Jul 22, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@soorya-u, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 29 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: c4496188-275b-4af3-a41c-5b3ce380372a

📥 Commits

Reviewing files that changed from the base of the PR and between cedae4d and 88e99ce.

📒 Files selected for processing (8)
  • apps/cli/src/git/git.test.ts
  • apps/cli/src/utils/fs.test.ts
  • docs/guides/TESTING_FRAMEWORK.md
  • docs/guides/VERIFY_LOOP.md
  • package.json
  • shared/database/package.json
  • tests/e2e/package.json
  • vitest.config.ts
📝 Walkthrough

Walkthrough

Changes

Root Vitest workspace

Layer / File(s) Summary
Root workspace orchestration
package.json, vitest.config.ts, turbo.json
Root scripts invoke Vitest projects directly; inline project configuration, Cloudflare Workers setup, and Istanbul coverage replace package-local wiring.
Package test wiring cleanup
apps/server/package.json, apps/web/package.json, shared/*, tests/e2e/*
Package-level unit scripts and local Vitest configurations are removed, TypeScript inputs exclude those configs, and database integration selects the root project.
Test entrypoints and guidance
.github/workflows/nightly.yml, tests/e2e/package.json, docs/...
Nightly, E2E, and documentation commands use root Vitest project selection.

Git test repository setup

Layer / File(s) Summary
es-git test repository initialization
apps/cli/src/git/git.test.ts, apps/cli/src/utils/fs.test.ts
Temporary repositories are initialized and committed through es-git rather than external Git processes.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Possibly related issues

  • soorya-u/cyrus issue 88 — The centralized root Vitest configuration and removal of package-local test wiring implement the described consolidation.

Possibly related PRs

  • soorya-u/cyrus#97 — Both changes centralize root Vitest projects and configure Istanbul coverage.
  • soorya-u/cyrus#101 — This change removes the package-local configurations introduced for shared package tests.
  • soorya-u/cyrus#103 — Both changes update E2E Vitest project registration and invocation.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Package-local Vitest configs and test:unit scripts were removed, root workspace scripts/config were added, and the reported test plan indicates the migration passed.
Out of Scope Changes check ✅ Passed The docs, workflow, and CLI test-harness changes all support the Vitest workspace migration, with no clear unrelated code changes.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: moving from package-local Vitest wiring to a root workspace setup.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch issue-96-retire-per-package-test-wiring

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@package.json`:
- Around line 42-43: Update the test:unit:ui script to add the same --project
filters used by test:unit, limiting Vitest UI watch mode to the unit projects
and excluding integration/e2e projects.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 8d2550fb-e3f3-4cb0-a254-fae058443455

📥 Commits

Reviewing files that changed from the base of the PR and between 6664fde and cedae4d.

⛔ Files ignored due to path filters (1)
  • bun.lock is excluded by !**/*.lock
📒 Files selected for processing (37)
  • .github/workflows/nightly.yml
  • apps/cli/src/git/git.test.ts
  • apps/cli/src/utils/fs.test.ts
  • apps/server/package.json
  • apps/server/vitest.config.ts
  • apps/web/package.json
  • apps/web/vitest.config.ts
  • docs/adr/0017-vitest-default-bun-only-cli-desktop.md
  • docs/guides/TESTING_FRAMEWORK.md
  • docs/guides/VERIFY_LOOP.md
  • package.json
  • shared/connections/package.json
  • shared/connections/tsconfig.json
  • shared/connections/vitest.config.ts
  • shared/constants/package.json
  • shared/constants/tsconfig.json
  • shared/constants/vitest.config.ts
  • shared/database/package.json
  • shared/database/tsconfig.json
  • shared/database/vitest.config.ts
  • shared/hooks/package.json
  • shared/hooks/tsconfig.json
  • shared/hooks/vitest.config.ts
  • shared/providers/package.json
  • shared/providers/tsconfig.json
  • shared/providers/vitest.config.ts
  • shared/schemas/package.json
  • shared/schemas/tsconfig.json
  • shared/schemas/vitest.config.ts
  • shared/utils/package.json
  • shared/utils/tsconfig.json
  • shared/utils/vitest.config.ts
  • tests/e2e/package.json
  • tests/e2e/tsconfig.json
  • tests/e2e/vitest.config.ts
  • turbo.json
  • vitest.config.ts
💤 Files with no reviewable changes (15)
  • apps/web/vitest.config.ts
  • shared/connections/vitest.config.ts
  • apps/server/vitest.config.ts
  • shared/connections/package.json
  • shared/schemas/vitest.config.ts
  • shared/hooks/vitest.config.ts
  • tests/e2e/vitest.config.ts
  • shared/database/vitest.config.ts
  • shared/constants/vitest.config.ts
  • apps/server/package.json
  • shared/utils/package.json
  • shared/schemas/package.json
  • turbo.json
  • shared/providers/vitest.config.ts
  • shared/utils/vitest.config.ts

Comment thread package.json Outdated
soorya-u and others added 3 commits July 22, 2026 14:51
Avoids spawning git under Lefthook pre-push, which was re-entering hooks and breaking ignore/status assertions.

Co-authored-by: Cursor <cursoragent@cursor.com>
Keeps @cyrus/e2e and @cyrus/database-integration out of the local UI watch surface.

Co-authored-by: Cursor <cursoragent@cursor.com>
Rename e2e and database-integration project labels so they sit outside that glob; multiple --project=!… flags OR together and cannot exclude both.

Co-authored-by: Cursor <cursoragent@cursor.com>
@soorya-u
soorya-u force-pushed the issue-96-retire-per-package-test-wiring branch from 7148b0e to 88e99ce Compare July 22, 2026 09:22
@soorya-u
soorya-u merged commit 9682783 into main Jul 22, 2026
9 checks passed
@soorya-u
soorya-u deleted the issue-96-retire-per-package-test-wiring branch July 22, 2026 09:23
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.

Retire per-package test-runner wiring now superseded by the root Vitest workspace

1 participant