Skip to content

Complete direct Bun repository test execution (Fixes #2578) - #3171

Merged
acoliver merged 3 commits into
mainfrom
issue2578-completion
Aug 8, 2026
Merged

Complete direct Bun repository test execution (Fixes #2578)#3171
acoliver merged 3 commits into
mainfrom
issue2578-completion

Conversation

@acoliver

@acoliver acoliver commented Aug 8, 2026

Copy link
Copy Markdown
Collaborator

TLDR

Completes the direct-Bun test migration umbrella by making the complete credentialed suite explicit, removing the final active Vitest runtime signal and obsolete cleanup, strengthening the zero-Vitest guard, and bringing the checked-in inventory and contributor docs in line with the repository's actual Bun-native execution model.

Dive Deeper

Acceptance evidence

  1. Complete checked-in inventory: dev-docs/test-runner-inventory.md now accounts for all 2,545 discovered test files and maps every root to its direct Bun command.
  2. Standard complete command: test:bun:all runs test:bun, the sandbox:none integration suite, and all evals in fail-fast order. Existing test:bun remains the complete uncredentialed repository suite across all 16 workspaces plus scripts/tests.
  3. No Vitest or precompiled-JS execution: the zero-Vitest guard scans active execution surfaces, manifests, lockfiles, scripts, configuration, and runtime environment references. All migrated suites execute TypeScript with Bun.
  4. No silent omission: the ownership guard reports zero uncovered and zero doubly executed test files; shard validation assigns all 16 workspaces; CLI discovery accounts for all 680 CLI test files.
  5. Execution infrastructure preserved: the shared Bun runner retains workspace setup and teardown, pretest guards, per-file isolation, path filtering, timeouts, JUnit output, and coverage integration.
  6. Required-platform CI: PR CI executes Bun-native Linux shards and fail-closed inventory guards; nightly CI executes the macOS and Windows Bun-native suites.
  7. Bounded compatibility surface: active process.env.VITEST signaling is removed. NODE_ENV=test remains the runner-independent test signal. The no-Vitest guard has direct Bun behavioral tests for dot and bracket environment references and false-positive controls.
  8. Residual Vitest inventory: current prose now distinguishes historical artifacts, compatibility names, Bun's vi API, guard fixtures, and inert command-orchestrator fixture values. None is an active Vitest execution surface.
  9. One canonical command: CONTRIBUTING.md, dev-docs/bun.md, the inventory, and package.json consistently identify test:bun:all as the complete credentialed command and test:bun as the complete uncredentialed command.

Mutation tooling boundary

Terminal issue #2970 and PR #3145 established that every Stryker configuration depended on dead Vitest execution, was absent from required workflows, and could not load Bun test suites. This PR does not recreate mutation tooling: doing so would add a new subsystem rather than preserve functioning migration behavior.

Behavioral changes

  • Adds the fail-fast aggregate test:bun:all script.
  • Removes production dependence on process.env.VITEST while preserving NODE_ENV=test behavior.
  • Extends the no-Vitest guard to reject active dot and bracket environment references while ignoring comments and string prose.
  • Removes unsafe obsolete pkill-based Vitest cleanup from the pre-push hook.
  • Adds Bun behavioral contract tests for the aggregate command and environment-reference guard.
  • Corrects current-state documentation and discovery counts.

Review evidence

  • Independent DeepThinker findings were triaged and all genuine in-scope findings were fixed.
  • Rustreviewer confirmed the aggregate command, all 16 Bun-native workspaces, 2,545-file ownership inventory, zero active Vitest execution surfaces, NODE_ENV behavior, and mutation-tooling boundary. Its residual-text classification finding was fixed.
  • Local and PR Open Code Review inspected the selected source and both new Bun suites. Genuine findings were fixed: the aggregate rejects every semicolon, and its runner contract now parses the command prefix and requires Bun as the executable without coupling to internal runner filenames.

Reviewer Test Plan

  1. Run bun run lint:no-vitest and confirm all active Vitest execution and process.env.VITEST forms are rejected.
  2. Run bun scripts/check-test-file-coverage.ts and confirm zero uncovered and zero doubly executed files.
  3. Run bun run lint:test-shards and bun run lint:cli-test-discovery.
  4. Run bun test scripts/tests/test-bun-all-script.bun.test.ts scripts/tests/no-vitest-env-reference.test.ts scripts/tests/no-vitest-guard.test.ts packages/core/src/utils/memoryDiscovery.test.ts packages/core/src/utils/memoryDiscovery.subfunctions.test.ts.
  5. Run bun run test:bun for the full uncredentialed suite.
  6. With provider credentials and quota available, run bun run test:bun:all to include sandbox:none integration tests and evals.

Testing Matrix

🍏 🪟 🐧
npm run
npx
Docker
Podman - -
Seatbelt - -

Local verification on macOS:

  • All 16 workspace suites passed by bounded composition, including CLI 680/680, agents 354/354 plus 6 native isolated files, core 363/363, and providers 558/558.
  • All 234 scripts/tests files passed by bounded composition.
  • Changed suites: 125 passed, 0 failed, 280 expectations.
  • Full build, post-build typecheck, formatting, formatting check, and StepFun smoke passed.
  • Complete root ESLint traversal passed through bounded scopes because the shell execution ceiling cannot retain one monolithic invocation.
  • Migration, ownership, shard, CLI discovery, copyright, document-placement, ESLint-policy, no-new-JS, shell syntax, and diff guards passed.
  • Credentialed test:bun:all was not run locally; its fail-fast command contract is covered directly, while credentialed integration and eval execution remains exercised by their established CI paths.

Linked issues / bugs

Fixes #2578

Related: #2970

@coderabbitai

coderabbitai Bot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You’ve reached a temporary PR review limit under our Fair Usage Limits Policy.

Your recent review volume is higher than typical usage, so adaptive limits are currently applied.

Next review available in: 13 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: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 8f0812f3-447e-4357-bb06-eeb71b5ae3da

📥 Commits

Reviewing files that changed from the base of the PR and between 542ca4f and 4c4aca0.

⛔ Files ignored due to path filters (2)
  • dev-docs/bun.md is excluded by !dev-docs/**
  • dev-docs/test-runner-inventory.md is excluded by !dev-docs/**
📒 Files selected for processing (13)
  • CHANGELOG.md
  • CONTRIBUTING.md
  • package.json
  • packages/core/src/config/configConstructor.ts
  • packages/core/src/utils/memoryDiscovery.subfunctions.test.ts
  • packages/core/src/utils/memoryDiscovery.test.ts
  • packages/core/src/utils/memoryDiscovery.ts
  • scripts/check-no-vitest.ts
  • scripts/pre-push-check.sh
  • scripts/test.ts
  • scripts/tests/no-vitest-env-reference.test.ts
  • scripts/tests/no-vitest-guard.test.ts
  • scripts/tests/test-bun-all-script.bun.test.ts

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added the maintainer:e2e:ok Trusted contributor; maintainer-approved E2E run label Aug 8, 2026
Comment thread scripts/tests/test-bun-all-script.bun.test.ts
Comment thread scripts/tests/test-bun-all-script.bun.test.ts Outdated
@github-actions

github-actions Bot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

OpenCodeReview — automatic reviews suspended

Automatic OCR reviews are suspended for this PR after 2 of 2 automatic reviews.

To get more reviews you can:

  • Check the box below to re-enable automatic reviews (resets the counter), or

  • Comment /review, /ocr, or /open-code-review to request a single review on demand.

  • Re-enable automatic reviews


OpenCodeReview — PR #3171

  • Reviewed head SHA: 98bace5f4e00f99e15dbe5d36ad44d247e5779e8
  • Merge base: bde72ea597c48fd72222cdb40928854689fe1210
  • Range: incremental from 7961e8f3c6402fc2e63020b9855905930a9a4ed8
  • Range fallback: none
  • Scope: selected 1 file(s), +1/-6; cumulative 24 file(s), +405/-96
  • Tokens: 56709 total (38381 input, 18328 output, 28672 cache)
  • OCR version: open-code-review v1.8.4 (e78474478) linux/amd64 built at: 2026-08-01T03:27:37Z https://github.com/alibaba/open-code-review
  • Phase: review
  • Exit code: 0
  • Run: https://github.com/vybestack/llxprt-code/actions/runs/31283064253
  • 2 finding(s) (2 posted inline).
  • Artifacts: ocr-review-output contains raw JSON, stdout, stderr, preview, phase, and exit-code diagnostics.

@github-actions

github-actions Bot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Walkthrough

Before this PR, the repository’s test workflow still carried Vitest-era baggage: runtime and config code checked for Vitest-specific environment variables, the pre-push hook cleaned up lingering Vitest processes, and the documentation did not fully reflect the Bun-native execution path as the single canonical workflow. After this PR, repository test execution is completed through direct Bun invocation; core runtime/test detection logic no longer carries Vitest-specific environment checks, the pre-push check matches the Bun-native flow, and a strengthened guard actively prevents Vitest references from being reintroduced. Documentation now describes the canonical Bun commands, credential requirements for excluded roots, and the completed migration state.

Release Notes

New Features

  • Added a repository-wide guard that actively prevents reintroduction of Vitest references in code, manifests, config filenames, scripts, lockfiles, and TOML files.

Bug Fixes

  • Removed obsolete Vitest process cleanup steps from the pre-push check script so it matches the current Bun-native test runner flow.
  • Removed Vitest-specific environment checks from runtime/test detection logic in core memory discovery and config construction.

Tests

  • Added behavioral tests verifying Bun-only test execution and the zero-Vitest guard across imports, manifests, config files, shell invocations, lockfiles, and TOML references.
  • Removed Vitest-specific environment setup from core test files to align with the Bun-native runtime.

Documentation

  • Updated project documentation to describe the new Bun-native test execution workflow, including canonical commands, credential requirements for excluded roots, and migration notes.

Refactor

  • Cleaned up core runtime/test detection logic to remove Vitest-specific environment checks.

Chore

  • Strengthened the repository guard that prevents reintroducing Vitest references.
  • Aligned pre-push checks with the Bun-native test runner flow.

Changes

Layer File(s) Summary
docs scripts/test.ts, CONTRIBUTING.md, CHANGELOG.md, dev-docs/bun.md, dev-docs/test-runner-inventory.md Updates project documentation to describe the new Bun-native test execution workflow, including canonical commands, credential requirements, and migration notes.
tests package.json, scripts/tests/test-bun-all-script.bun.test.ts, scripts/tests/no-vitest-env-reference.test.ts, packages/core/src/utils/memoryDiscovery.test.ts, packages/core/src/utils/memoryDiscovery.subfunctions.test.ts, scripts/tests/no-vitest-guard.test.ts Adds and adjusts tests to verify Bun-only test execution, validates the zero-Vitest guard, and removes Vitest-specific environment setup from core test files.
core packages/core/src/utils/memoryDiscovery.ts, packages/core/src/config/configConstructor.ts, scripts/check-no-vitest.ts Removes Vitest-specific environment checks from runtime/test detection logic and strengthens the repository guard that prevents reintroducing Vitest references.
ci scripts/pre-push-check.sh Removes obsolete Vitest process cleanup steps from the pre-push check script to match the new Bun-native test runner flow.

Magnitude

🎯 2 (M)
403 additions, 86 deletions, 15 changed files across 1 package, 10 acceptance criteria

Related

Pre-merge Checks

Check Status Note
Title Clear and descriptive title that indicates the PR completes direct Bun test execution and references the fixed issue.
Description All required template sections are present: TLDR, Dive Deeper, Reviewer Test Plan, Testing Matrix, and Linked issues / bugs.
Linked Issues Actual changes fulfill the linked #2578 acceptance criteria: adds complete credentialed test:bun:all command, removes remaining process.env.VITEST signals from production and test code, strengthens the zero-Vitest guard, updates documentation and inventory to reflect Bun-native execution, and adds behavioral tests for the aggregate command and environment-reference guard. CI platform coverage appears to have been established in the prerequisite #3145 merge.
Out of Scope No CI workflow file modifications are present in the actual changes; CI platform execution claims rely on the prior #3145 merge. No new compatibility helpers were added (criterion satisfied vacuously). The PR does not recreate mutation tooling, which was explicitly out of scope per the PR description and #2970 findings.

Walkthrough generated by LLxprt PR Review. Planner issue: #2256

Comment thread scripts/tests/test-bun-all-script.bun.test.ts Outdated
Comment thread scripts/tests/test-bun-all-script.bun.test.ts Outdated
@acoliver
acoliver force-pushed the issue2578-completion branch from 41bc3e9 to 4c4aca0 Compare August 8, 2026 23:15
@acoliver
acoliver merged commit a4951f9 into main Aug 8, 2026
42 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer:e2e:ok Trusted contributor; maintainer-approved E2E run

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Migrate all remaining repository tests to direct Bun execution

1 participant