Repository navigation
test: convert script-style test files to node:test blocks - #428
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…st blocks Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…locks Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…st blocks Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…locks Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ocks Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Utility and artifact test suites src/agents-skill.test.ts, src/apply-patch.test.ts, src/artifact-download.test.ts, src/bin-launcher.test.ts, src/incoming-artifacts.test.ts, src/skills.test.ts, test/package-install-smoke.test.ts |
Registers existing assertions as named tests. Temporary directories use test-context cleanup where needed, and unsupported platform download checks use skip options. |
CLI and configuration test suites src/cli-workspace.test.ts, src/cli.test.ts, src/config*.test.ts, src/dev-state.test.ts, src/onboarding.test.ts, src/roots.test.ts, src/user-config.test.ts, src/workflow-cli.test.ts |
Separates CLI, configuration, onboarding, root-resolution, migration, and workflow CLI checks into named tests. Shared setup and cleanup use fixtures or runner hooks. |
Local agent provider and presentation tests src/local-agent-acp.test.ts, src/local-agent-adapters.test.ts, src/local-agent-availability.test.ts, src/local-agent-claude.test.ts, src/local-agent-codex.test.ts, src/local-agent-config.test.ts, src/local-agent-events.test.ts, src/local-agent-grok.test.ts, src/local-agent-opencode*.test.ts, src/local-agent-pi*.test.ts, src/local-agent-presentation.test.ts, src/local-agent-profiles.test.ts, src/local-agent-targets.test.ts |
Organizes existing provider, adapter, runtime, availability, and presentation checks as named tests. Several suites use per-test fixtures and cleanup hooks. |
Agent manager, daemon, and worktree tests src/local-agent-manager.test.ts, src/local-agent-daemon*.test.ts, src/local-agent-runtime.test.ts, src/local-agent-worktree.test.ts |
Moves manager, daemon, runtime, and worktree checks into isolated test cases. Fixtures create scoped state and register cleanup with the test runner. |
Process, persistence, and workflow tests src/process-*.test.ts, src/oauth-*.test.ts, src/server-shutdown.test.ts, src/workflow-runner.test.ts, src/workflow-schema.test.ts, src/workflow-script.test.ts |
Registers process, OAuth, shutdown, and workflow checks as Node tests. Test-scoped cleanup replaces several shared temporary roots and try/finally blocks. |
Priority:
Estimated code review effort: 3 (Moderate) | ~30 minutes
Change: Refactor
Possibly related PRs
- Waishnav/devspace#423: Both PRs convert script-style tests to Node test-runner cases in overlapping parts of the suite.
- Waishnav/devspace#425: Both PRs restructure the test suite, with this PR converting remaining checks and adding test-scoped fixtures.
Suggested reviewers: kotovasia5120, jplew, zhenyu98
Merge Risk: 
Minimal · up to 5fecb
-
This change reorganizes tests into named blocks with per-test cleanup and does not alter product behavior. No concrete merge-blocking issue was found.
Pre-merge checks: 
4 · 
1
-
Failed checks: 1 warning Passed checks: 4 passedFull details: Docstring Coverage
-
Explanation
Docstring coverage is 17.07% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 41 functions across 46 files.
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
-
Finishing Touches: 💡 2
-
📝 Generate docstrings: 💡
-
- Commit to this branch
- Create a new PR
🛠️ Fix failing CI checks: 💡
-
- Commit to this branch
- Create a new PR
🧪 Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
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.
A rabbit checks each case by name,
And gives each test its proper frame.
Fresh roots are cleared when tests are done,
While skipped checks await their run.
The suite now hops from start to end,
With tidy fixtures as its friend.
Comment @coderabbitai help to get the list of available commands.
🚀 Deploying Preview to Cloudflare 🚀Preview Deployments by commit
|
Stacked on #425.
46 of the test files were top-level scripts: chains of
assertcalls with notest()blocks. When one assertion failed, the file crashed and reported no test name, every later scenario in the file was skipped, and scenarios shared mutable state. For example,local-agent-manager.test.tscreated a stale record around line 182 and only checked it around line 432. The ACP and OpenCode tests counted protocol calls on a request log that earlier scenarios had already written to.Every file is now a set of named
node:testblocks with its own fixtures andt.aftercleanup. PatchedHOME, env, andDate.noware restored after each test. The suite goes from 209 to 552 named tests. Where a call-count assertion depended on calls made by an earlier scenario, that test now makes those calls itself, so the count still checks the same thing. Steps that genuinely build on each other stay in one test: the dev-state seed/reset flow, the Pi pool lifecycle, and the CLI package-install smoke. The Pi sandbox's shared try block is split into six tests, so one boundary failure no longer hides the others. It still fails whenDEVSPACE_REQUIRE_PI_SANDBOX=1is set and the sandbox is unavailable, and skips otherwise.Assertions are unchanged. Per-file assertion counts are equal, except three tool-presence preconditions now repeated in the tests that rely on them. Timing values are untouched. Every test was also run alone with
--test-name-patternto confirm it passes on its own.Coverage is unchanged file by file: each converted file lost zero lines against its own baseline. The full-suite comparison reports five lines in
src/local-agent-manager.ts(264–268), but that is an artifact of Node's coverage merge, not lost coverage. None of the three test files that touch that code reaches those lines when run alone, before or after this change, yet merging any two of them reports a hit.Most of the diff is re-indentation;
git diff -wis +2052/−1017.🤖 Generated with Claude Code
Summary by CodeRabbit