Skip to content

chore(tests): prefer silent tests#4660

Merged
miguel-nascimento merged 7 commits into
mainfrom
miguel/tweak-test-noise
Dec 18, 2025
Merged

chore(tests): prefer silent tests#4660
miguel-nascimento merged 7 commits into
mainfrom
miguel/tweak-test-noise

Conversation

@miguel-nascimento

@miguel-nascimento miguel-nascimento commented Dec 8, 2025

Copy link
Copy Markdown
Contributor

SDK tests was spamming in CI. It's impossible to read things due to the spam of rpc retries.
This PR adds --silent=passed-only. https://vitest.dev/config/silent.html#silent

I also removed the load-env by loading the .env in the vitest root.

@vercel

vercel Bot commented Dec 8, 2025

Copy link
Copy Markdown

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

Project Deployment Review Updated (UTC)
river-sample-app Ready Ready Preview, Comment Dec 17, 2025 11:01pm

@cursor

cursor Bot commented Dec 8, 2025

Copy link
Copy Markdown

PR Summary

Silences Vitest output and replaces per-package dotenv-cli usage by loading .env from the root vitest.config.mts.

  • Tests:
    • Use vitest --silent=passed-only across packages (bot, sdk, utils, web3, encryption, proto, stream-metadata, stress) and simplify test scripts.
    • Remove noisy flags and watch/load wrappers; standardize CI scripts (test:ci, test:ci:multi:*, test:unit).
  • Env Loading:
    • Add dotenv (root) and load packages/generated/deployments/local_dev/.env in vitest.config.mts.
    • Remove dotenv-cli and load-env script usage across packages, relying on central config.

Written by Cursor Bugbot for commit ad305c6. This will update automatically on new commits. Configure here.

@coderabbitai

coderabbitai Bot commented Dec 8, 2025

Copy link
Copy Markdown
Contributor

Caution

Review failed

The pull request is closed.

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

📝 Walkthrough

Walkthrough

Remove load-env/dotenv-cli usage and update test scripts across packages to call vitest directly (often with --silent=passed-only); add dotenv.config call in vitest.config.mts to load a specific .env file at module init.

Changes

Cohort / File(s) Summary
Remove load-env & dotenv-cli
packages/bot/package.json, packages/sdk/package.json, packages/stream-metadata/package.json, packages/stress/package.json, packages/web3/package.json
Removed load-env script entries and removed dotenv-cli from devDependencies; test scripts updated to invoke vitest directly instead of via bun run load-env or dotenv wrapper.
Direct vitest CI script updates
packages/encryption/package.json, packages/proto/package.json, packages/utils/package.json
Replaced bun run test (or Bun-wrapped invocations) with vitest run --silent=passed-only for CI-oriented test:ci scripts.
Multiple test script edits (per-package)
packages/bot/package.json, packages/sdk/package.json, packages/stress/package.json
Edited various test scripts (test, test:ci:multi:ent, test:watch, test:unit, test:stress, etc.) to call vitest directly and use --silent=passed-only or appropriate config flags; SDK retains explicit vitest.config references.
Runtime dotenv injection
vitest.config.mts
Added import 'dotenv/config'-style integration (explicit dotenv import and dotenv.config) to load packages/generated/deployments/local_dev/.env at module initialization so env vars are present for tests.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Pay attention to environment-loading changes: verify the new vitest config dotenv load path and that it covers all test cases previously relying on load-env.
  • Check CI invocations that previously relied on Bun wrappers for any Bun-specific behavior now missing.
  • Review SDK's vitest.config references for correctness after command changes.

Possibly related PRs

Suggested reviewers

  • salzbrenner
  • sergekh2

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Title check ✅ Passed Title accurately summarizes the main change: updating test scripts to use silent mode for passed tests only.
Description check ✅ Passed Description is related to the changeset, explaining the motivation (reducing CI noise) and the implementation approach (--silent=passed-only).

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a34df6e and ad305c6.

⛔ Files ignored due to path filters (2)
  • bun.lock is excluded by !**/*.lock, !bun.lock
  • package.json is excluded by !package.json
📒 Files selected for processing (9)
  • packages/bot/package.json (1 hunks)
  • packages/encryption/package.json (1 hunks)
  • packages/proto/package.json (1 hunks)
  • packages/sdk/package.json (1 hunks)
  • packages/stream-metadata/package.json (1 hunks)
  • packages/stress/package.json (1 hunks)
  • packages/utils/package.json (1 hunks)
  • packages/web3/package.json (1 hunks)
  • vitest.config.mts (1 hunks)

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 and usage tips.

Comment thread packages/bot/package.json Outdated
@miguel-nascimento miguel-nascimento marked this pull request as draft December 8, 2025 23:45
@miguel-nascimento miguel-nascimento changed the title chore(tests): use bun runtime and prefer silent chore(tests): prefer silent tests Dec 8, 2025
@miguel-nascimento miguel-nascimento removed the request for review from shuhuiluo December 8, 2025 23:52
@miguel-nascimento miguel-nascimento changed the title chore(tests): prefer silent tests chore(tests): prefer silent tests & use bun in vitest Dec 9, 2025
@shuhuiluo

Copy link
Copy Markdown
Contributor

Bun is claimed to be 5x faster than Vitest.
https://bun.sh/docs/test

@miguel-nascimento miguel-nascimento changed the title chore(tests): prefer silent tests & use bun in vitest chore(tests): prefer silent tests Dec 9, 2025
The stream-metadata dev:local_dev script uses dotenv-cli but it was
removed from its devDependencies. Adding to root for monorepo sharing.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

@texuf texuf left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

i was doing a similar thing here #4700, the passed-only. is cool! i'll use that.

@miguel-nascimento miguel-nascimento merged commit c683267 into main Dec 18, 2025
21 of 23 checks passed
@miguel-nascimento miguel-nascimento deleted the miguel/tweak-test-noise branch December 18, 2025 00:40
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.

3 participants