Skip to content

build(deps): upgrade to vitest 5 - #120

Merged
trvon merged 1 commit into
build/dependabot-batch-2from
build/vitest-5
Sep 20, 2026
Merged

trvon merged 1 commit into
build/dependabot-batch-2from
build/vitest-5

Conversation

@trvon

@trvon trvon commented Sep 20, 2026

Copy link
Copy Markdown
Owner

Summary

Completes the vitest 5 upgrade that #119 held back (closes the migration deferred from #106 and #108). Moves vitest and @vitest/coverage-v8 to 5.x and adapts the benchmark tooling to the redesigned API.

Vitest 5 removed:

  • the module-level bench() export (it now lives on the test context: test("...", ({ bench }) => ...)),
  • the built-in benchmark result table,
  • the --outputJson and --compare CLI flags.

Changes:

  • benchmarks/core.bench.ts rewritten against the context bench() API. Timing (time/warmupTime) moved from per-benchmark options to the run options passed to .run().
  • benchmarks/report.ts (new) holds pure, tested helpers for the results table, the baseline JSON, and the throughput comparison — the formatting vitest 5 no longer provides.
  • bench:baseline / bench:compare now select mode through BENCH_BASELINE_OUT / BENCH_BASELINE_IN env vars instead of the removed flags. The baseline still lands at .artifacts/benchmarks/baseline.json and the operator workflow is unchanged.
  • test/benchmark-report.test.ts (new) covers the report helpers, including the new-benchmark and zero-baseline edge cases in the comparison math.
  • docs/TESTING.md documents the three bench scripts.

Also gives the never persists more fires than the selected controller cap property test a 60s timeout (same fix as #119) — it does real store I/O and intermittently exceeded the 15s default under parallel load. If #119 merges first, this hunk is identical and rebases cleanly.

Test plan

  • npm run test:coverage — 67 files, 1066 tests pass; coverage above thresholds
  • npm run typecheck, npm run lint (2 pre-existing warnings), npm run build
  • npm run test:package, npm run test:property
  • npm run bench, npm run bench:baseline, npm run bench:compare all produce output
  • npm audit --audit-level=moderate — 0 vulnerabilities

Note

Benchmarking is marked experimental in vitest 5, so the report.ts helpers deliberately depend only on the stable tinybench statistics (latency/throughput means, rme), not on vitest's evolving benchmark types.

Copilot AI lite review requested due to automatic review settings September 20, 2026 00:28

Copilot AI 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.

Copilot review overview

🟢 Approval recommended

Reviewed changes have no unresolved blocking issues.

Review effort: Lite
Findings: None

What changed in this PR

Upgrades Vitest and coverage tooling to 5.x, adapting benchmark execution and reporting to the redesigned API.

Changes:

  • Migrates benchmarks to Vitest 5’s context-based API.
  • Adds tested reporting, baseline, and comparison helpers.
  • Updates dependencies, documentation, scripts, and a property-test timeout.
File Description
test/​property/​store.property.test.ts Increases the I/O-heavy property-test timeout.
test/​benchmark-report.test.ts Tests benchmark reporting and comparison behavior.
package.json Upgrades Vitest dependencies and benchmark scripts.
package-lock.json Locks updated dependency versions.
docs/​TESTING.md Documents benchmark commands and output.
benchmarks/​report.ts Provides benchmark reporting and comparison helpers.
benchmarks/​core.bench.ts Uses the Vitest 5 benchmark context API.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@trvon
trvon changed the base branch from master to build/dependabot-batch-2 September 20, 2026 02:07
@trvon

trvon commented Sep 20, 2026

Copy link
Copy Markdown
Owner Author

Restacked: this PR now targets build/dependabot-batch-2 (#119) instead of master, so its diff is the vitest 5 change alone. Merge #119 first, then this. The shared store-property timeout fix now comes from #119 and is no longer duplicated here.

@trvon
trvon added this pull request to stack #121 September 20, 2026 02:20
Move vitest and @vitest/coverage-v8 to 5.x. Vitest 5 removed the module-level
bench() export, the built-in benchmark table, and the --outputJson/--compare
flags. Rewrite benchmarks/core.bench.ts against the context bench() API (run
options carry time/warmupTime) and add benchmarks/report.ts for table,
baseline, and comparison formatting, selected via BENCH_BASELINE_OUT/_IN. Cover
the report helpers with a unit test and document the bench scripts.

Also give the disk-bound workflow store property its own 60s timeout, which
intermittently exceeded the default under parallel load.
@trvon
trvon merged commit e301731 into master Sep 20, 2026
5 checks passed
@trvon
trvon deleted the build/vitest-5 branch September 20, 2026 02:43
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