Skip to content

fix(rstack): support latest Rstest CLI entry - #460

Merged
chenjiahan merged 1 commit into
mainfrom
fix/rstest-run-cli-compat
Sep 4, 2026
Merged

fix(rstack): support latest Rstest CLI entry#460
chenjiahan merged 1 commit into
mainfrom
fix/rstest-run-cli-compat

Conversation

@SoonIter

@SoonIter SoonIter commented Sep 4, 2026

Copy link
Copy Markdown
Member

Summary

  • keep using the root runCLI export with Rstest 0.11.x
  • fall back to @rstest/core/api after the programmatic API rewrite moved the export
  • restore compatibility for rs test consumers without changing command arguments

Validation

  • pnpm --filter rstack build
  • node packages/rstack/dist/index.js test --version
  • pnpm check reached and passed lint/type checking, then stopped because the local native binding was unavailable

Ecosystem CI

This addresses the shared runCLI is not a function failure in Rstest ecosystem CI for Rsbuild and Rsdoctor, plus the declaration error in rstack-cli after web-infra-dev/rstest#1729.

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

chatgpt-codex-connector Bot commented Sep 4, 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-04T09:19:42.657802Z 267ca09 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.

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying rstack-cli with  Cloudflare Pages  Cloudflare Pages

Latest commit: 267ca09
Status: ✅  Deploy successful!
Preview URL: https://20b4d9c4.rstack-cli.pages.dev
Branch Preview URL: https://fix-rstest-run-cli-compat.rstack-cli.pages.dev

View logs

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 new @rstest/core/api runCLI expects argv after rstest, but the current implementation always passes a full process.argv-shaped array, which can break parsing on newer Rstest versions.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

This PR updates rstack’s rs test command to remain compatible with both Rstest 0.11.x (where runCLI is exported from @rstest/core) and newer Rstest versions where runCLI moved to @rstest/core/api, without changing CLI arguments for rs test users.

Changes:

  • Adds a runtime fallback to import runCLI from @rstest/core/api when it’s missing from @rstest/core.
  • Introduces local typing/casting to support both entrypoints while keeping the CLI call site stable.
File summaries
File Description
packages/rstack/src/cli/commands.ts Adds a fallback import path for Rstest’s runCLI to support the new CLI entrypoint.
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.

Comment thread packages/rstack/src/cli/commands.ts
@chenjiahan
chenjiahan merged commit 74e6676 into main Sep 4, 2026
6 checks passed
@chenjiahan
chenjiahan deleted the fix/rstest-run-cli-compat branch September 4, 2026 11:00
@SoonIter

SoonIter commented Sep 5, 2026

Copy link
Copy Markdown
Member Author

<agent: daily-job rstack ecosystem-ci>

Ecosystem CI regression: rstest/rstack-cli and rstest/rsbuild

Attribution: Confirmed source for the current failure signature

Impact: Both consumers now start Rstest, but exit with No test files found because node and rstest are interpreted as test filters.

Why this PR

This PR correctly added the new @rstest/core/api fallback, but forwards the same full Node.js argv shape used by the legacy root export. The rewritten API introduced in web-infra-dev/rstest#1729 expects only the arguments written after rstest, so the first two argv entries become filters and exclude every test. This is a follow-up compatibility bug in Rstack CLI, not a regression from the current Rstest surface commit.

Suggested next step

Use the legacy full argv only for the root export and pass argv.slice(2) to the /api export. The focused fix is in #462; verify with the Rstest ecosystem rstack-cli and rsbuild suites.

Evidence and attribution checks
  • Current run: https://github.com/rstackjs/rstack-ecosystem-ci/actions/runs/33955040129
  • Tested upstream: rstest at d9622c3e8ba7e3c7f281a0d3e9f8899689687779
  • Current downstreams: rstack-cli 5694d35b9e912b86bbf64467faaefadd84566ac6 and Rsbuild 86edd2dec3d07dfd0c2e70a97c1d4478ca4183c5, both consuming Rstack 0.7.3
  • Previous completed run: https://github.com/rstackjs/rstack-ecosystem-ci/actions/runs/33859047329 used pre-fix(rstack): support latest Rstest CLI entry #460 rstack-cli 57340737f289bf69c8c4061f5b951fc4efa6027d and pre-0.7.3 Rsbuild 7a1369dfe78ad3ff334af0b996f25423e9964c2e; it failed with the older missing-root-export signatures instead
  • Failure signature: Rstest reports filters /opt/hostedtoolcache/node/24.18.0/x64/bin/node, rstest, then No test files found
  • Flaky/pre-existing check: the exact filter signature is absent from the previous completed row and automation history
  • Config check: not applicable; the failure occurs during CLI argument parsing before test discovery
  • Alternatives ruled out: Rstest #1788 only changes environment bundle sourcemap scanning; its diff does not touch CLI argument parsing

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