Skip to content

test(ci): run server/ + shared/ vitest suites in the merge gate#437

Open
HomenShum wants to merge 1 commit into
mainfrom
ci/server-shared-merge-gate
Open

test(ci): run server/ + shared/ vitest suites in the merge gate#437
HomenShum wants to merge 1 commit into
mainfrom
ci/server-shared-merge-gate

Conversation

@HomenShum
Copy link
Copy Markdown
Owner

Summary

server/ and shared/ sit outside src/ and packages/*, so their *.test.ts
files were covered by neither the segmented runner (npm run test:run) nor
the required Runtime smoke CI job — they only ever got type-checked. Tests there
could rot silently as the code they cover changed. This was the root cause behind
the tri-search rerank suite passing CI while failing locally.

This PR closes that gap and fixes the one suite the new gate immediately surfaced.

  • Add server and shared segments to scripts/testing/runSegmentedVitest.mjs
    (filter mode, i.e. npx vitest run server/--dir silently drops files under
    server/test/** and 4 files under shared/, so filter mode is used to match the
    validated command exactly).
  • Add test:run:server / test:run:shared npm scripts.
  • Invoke the segments from the required Runtime smoke job (--only server,shared)
    and trim the now-redundant individual server/* entries from the hardcoded smoke list.
  • Modernize server/commandBridge.test.ts to the user-scoped CommandBridge API
    (userId-first query/dispatch signatures, broadcastbroadcastToUser). It had
    rotted against the source for the same reason — it never ran in CI.

Local verification:

  • node scripts/testing/runSegmentedVitest.mjs --only server,shared → green
    (server 23 passed / 1 skipped, shared 15 passed).
  • npx tsc --noEmit --pretty false → 0 errors.

Test plan

  • CI Runtime smoke job shows a "Server + shared vitest segments" step that
    runs === server-vitest === and === shared-vitest === and passes.
  • Typecheck and Build stay green.

🤖 Generated with Claude Code

server/ and shared/ live outside src/ and packages/*, so they were covered
by neither the segmented runner nor the required Runtime smoke job — tests
there only ever got type-checked and could rot silently (surfaced when the
tri-search rerank suite failed locally despite green CI).

- add `server` and `shared` segments to runSegmentedVitest.mjs in filter mode,
  matching `npx vitest run server/` so files under server/test/* are not
  dropped the way `--dir` drops them
- add test:run:server / test:run:shared npm scripts
- invoke the segments from the required Runtime smoke CI job (trim the now
  redundant individual server/* entries from the smoke list)
- modernize commandBridge.test.ts to the user-scoped CommandBridge API
  (userId-first query/dispatch signatures, broadcast -> broadcastToUser) so the
  newly-enforced suite passes

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented May 29, 2026

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

Project Deployment Actions Updated (UTC)
nodebench-ai Ready Ready Preview, Comment May 29, 2026 2:19am

Request Review

@augmentcode
Copy link
Copy Markdown

augmentcode Bot commented May 29, 2026

🤖 Augment PR Summary

Summary: This PR adds missing CI coverage for Vitest suites under server/ and shared/ so tests outside src/ and packages/* can’t silently rot.

Changes:

  • Updates the Runtime smoke GitHub Actions job to run server/ + shared/ Vitest segments as a dedicated merge-gate step.
  • Extends scripts/testing/runSegmentedVitest.mjs with new server and shared segments (both required).
  • Adds test:run:server and test:run:shared npm scripts that run Vitest in “filter” mode for those directories.
  • Modernizes server/commandBridge.test.ts to the user-scoped CommandBridge API (userId-first signatures and broadcastToUser).
  • Adds helper repo export scripts for a ScratchNode Live public export target.

Technical Notes: The server/shared segments use filter mode (vs --dir) to avoid Vitest silently skipping some tests in those directories, and the runtime-smoke hardcoded list drops individual server test paths now covered by the full server segment.

🤖 Was this summary useful? React with 👍 or 👎

Copy link
Copy Markdown

@augmentcode augmentcode Bot left a comment

Choose a reason for hiding this comment

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

Review completed. 1 suggestion posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

Comment thread .github/workflows/ci.yml
# tri-search rerank suite) could rot silently. Running the segments here
# puts them in the required merge gate.
- name: Server + shared vitest segments
run: node scripts/testing/runSegmentedVitest.mjs --only server,shared
Copy link
Copy Markdown

@augmentcode augmentcode Bot May 29, 2026

Choose a reason for hiding this comment

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

At .github/workflows/ci.yml:93, this invokes runSegmentedVitest.mjs, but runShell() in that script starts a timeout that isn’t cleared when the child process exits; if the server,shared suites finish in <300s, the step can remain alive until the timer fires. That would add a fixed ~5 minute delay to the required merge gate even when tests complete quickly.

Severity: medium

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

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.

2 participants