Skip to content

fix(rstack): pass compatible Rstest CLI args - #462

Open
SoonIter wants to merge 1 commit into
mainfrom
fix/rstest-cli-argv-compat
Open

fix(rstack): pass compatible Rstest CLI args#462
SoonIter wants to merge 1 commit into
mainfrom
fix/rstest-cli-argv-compat

Conversation

@SoonIter

@SoonIter SoonIter commented Sep 5, 2026

Copy link
Copy Markdown
Member

Summary

  • preserve the full Node.js argv shape for Rstest 0.11.x's root runCLI export
  • pass only command arguments to the rewritten @rstest/core/api entry
  • restore test discovery for Rstest ecosystem consumers using Rstack CLI 0.7.3

Validation

  • pnpm --filter rstack build
  • pnpm check (lint and type check passed; formatting then stopped because the local native binding was unavailable)
  • node dist/index.js test list from packages/rstack with Rstest 0.11.12
  • git diff --check

The 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 filters node and rstest, producing No test files found in rstack-cli and Rsbuild.

Related: #460 and web-infra-dev/rstest#1729.

Copilot AI lite review requested due to automatic review settings September 5, 2026 09:12
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 5, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-05T09:14:27.474105Z 477a1b8 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

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.

🟡 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 root runCLI with the full Node-style argv array when that export is available.
  • Fall back to @rstest/core/api’s runCLI and 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) });
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