fix(rstack): pass compatible Rstest CLI args - #462
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
🟡 Changes recommended
The compatibility-sensitive argv branching should be covered by a regression test (e.g., via module mocking) to prevent future breakages in test discovery and filtering behavior.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR restores Rstest compatibility in rstack by forwarding argv in the shape expected by the specific runCLI entrypoint exposed by the installed Rstest version, addressing broken test discovery in some ecosystem consumers.
Changes:
- Call
@rstest/core’s rootrunCLIwith the full Node-style argv array when that export is available. - Fall back to
@rstest/core/api’srunCLIand pass only command arguments (argv.slice(2)) to match the rewritten programmatic API expectations.
File summaries
| File | Description |
|---|---|
| packages/rstack/src/cli/commands.ts | Adjusts how rs test forwards argv to Rstest depending on which runCLI export is present, restoring test discovery behavior. |
Review details
- Files reviewed: 1/1 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| const { runCLI } = (await import('@rstest/core/api')) as unknown as { | ||
| runCLI: RunCLI; | ||
| }; | ||
| runCLI({ argv: argv.slice(2) }); |
Summary
runCLIexport@rstest/core/apientryValidation
pnpm --filter rstack buildpnpm check(lint and type check passed; formatting then stopped because the local native binding was unavailable)node dist/index.js test listfrompackages/rstackwith Rstest 0.11.12git diff --checkThe local native build could not complete because the Rust toolchain download ran out of disk space. The current ecosystem failure was verified against Rstest commit
d9622c3e: the full argv was interpreted as the filtersnodeandrstest, producingNo test files foundin rstack-cli and Rsbuild.Related: #460 and web-infra-dev/rstest#1729.