tests: unify test execution with Vitest#61
Conversation
Greptile SummaryUnifies all test execution under a single Vitest runner, replacing the previous
Confidence Score: 4/5
Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A["npm test"] --> B["vitest run --config vitest.config.mjs"]
B --> C["pi/extensions/heartbeat.test.mjs\n(Vitest native — 54 tests)"]
B --> D["pi/extensions/memory.test.mjs\n(Vitest native — 44 tests)"]
B --> E["control-plane/server.test.mjs\n(Vitest native — 16 tests)"]
B --> F["test/legacy-node-tests.test.mjs\n(wrapper — 3 tests)"]
B --> G["test/shell-scripts.test.mjs\n(wrapper — 2 tests)"]
B --> H["test/security-audit.test.mjs\n(fixture-based — 3 tests)"]
F -->|"spawnSync node --test"| F1["tool-guard.test.mjs"]
F -->|"spawnSync node --test"| F2["security.test.mjs"]
F -->|"spawnSync node --test"| F3["scan-extensions.test.mjs"]
G -->|"spawnSync bash"| G1["baudbot-safe-bash.test.sh"]
G -->|"spawnSync bash"| G2["redact-logs.test.sh"]
H -->|"spawnSync bash"| H1["bin/security-audit.sh"]
style A fill:#4CAF50,color:#fff
style B fill:#2196F3,color:#fff
style C fill:#E1BEE7
style D fill:#E1BEE7
style E fill:#E1BEE7
style F fill:#FFE0B2
style G fill:#FFE0B2
style H fill:#FFE0B2
Last reviewed commit: 8fceb6d |
| ``` | ||
|
|
||
| Add new test files to `bin/test.sh` — don't scatter test invocations across CI or docs. | ||
| Add new test files to `vitest.config.mjs` (and shell wrappers under `test/` as needed) — don't scatter test invocations across CI or docs. |
There was a problem hiding this comment.
Stale bin/test.sh references elsewhere
This line correctly says to add new test files to vitest.config.mjs, but several other files still reference the old bin/test.sh runner and were not updated in this PR:
CONTRIBUTING.md(lines 13–20) — still documentsbin/test.shcommands.github/PULL_REQUEST_TEMPLATE.md(line 7) — checklist says "Tests pass (bin/test.sh)"bin/ci/setup-ubuntu.sh:72andbin/ci/setup-arch.sh:61— droplet CI scripts still callbash bin/test.shbin/baudbot:252— the CLItestsubcommand still delegates tobin/test.sh
Per the repo convention ("When changing behavior, update all docs"), these should be updated to reference npm test / vitest.config.mjs.
Context Used: Context from dashboard - CLAUDE.md (source)
Prompt To Fix With AI
This is a comment left during a code review.
Path: AGENTS.md
Line: 126
Comment:
**Stale `bin/test.sh` references elsewhere**
This line correctly says to add new test files to `vitest.config.mjs`, but several other files still reference the old `bin/test.sh` runner and were not updated in this PR:
- `CONTRIBUTING.md` (lines 13–20) — still documents `bin/test.sh` commands
- `.github/PULL_REQUEST_TEMPLATE.md` (line 7) — checklist says "Tests pass (`bin/test.sh`)"
- `bin/ci/setup-ubuntu.sh:72` and `bin/ci/setup-arch.sh:61` — droplet CI scripts still call `bash bin/test.sh`
- `bin/baudbot:252` — the CLI `test` subcommand still delegates to `bin/test.sh`
Per the repo convention ("When changing behavior, update all docs"), these should be updated to reference `npm test` / `vitest.config.mjs`.
**Context Used:** Context from `dashboard` - CLAUDE.md ([source](https://app.greptile.com/review/custom-context?memory=301c5d5e-f39f-40b0-952d-acd5ddc604f4))
How can I resolve this? If you propose a fix, please make it concise.There was a problem hiding this comment.
Good catch — I updated the stale docs references in this PR:\n- CONTRIBUTING.md now uses npm test / npm run test:*\n- .github/PULL_REQUEST_TEMPLATE.md now checks npm test\n\nFor the bin/ci/* scripts and bin/baudbot, those still intentionally delegate to bin/test.sh as a compatibility wrapper in admin-managed bin/ paths.\n\nResponded by pi-coding-agent using openai/gpt-5.
56c5fb7 to
96c25a4
Compare
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
Summary
npm test,npm run test:js,npm run test:shell,npm run test:coverage)vitest.config.mjsand new wrapper suites undertest/:test/legacy-node-tests.test.mjsruns existingnode:testsuites (tool-guard, bridge security, extension scanner)test/shell-scripts.test.mjsruns shell-script suites (safe-bash + redact-logs)test/security-audit.test.mjsadds focused fixture-based checks forbin/security-audit.shpi/extensions/heartbeat.test.mjs,pi/extensions/memory.test.mjs,control-plane/server.test.mjs)control-plane/server.test.mjsstartup diagnostics when the child server exits before readinessnpm test+npm run test:coverage)README.md,AGENTS.md) and control-agent memory note to reflect the new test commandsvitest,@vitest/coverage-v8,express)Validation
npm testnpm run test:jsnpm run test:shellnpm run test:coveragenpm run lintnpm run typecheck