Skip to content

test(e2e): assert no framework warnings in browser-mode CLI output#1242

Merged
fi3ework merged 1 commit into
mainfrom
ci/fail-on-warning
May 12, 2026
Merged

test(e2e): assert no framework warnings in browser-mode CLI output#1242
fi3ework merged 1 commit into
mainfrom
ci/fail-on-warning

Conversation

@fi3ework

@fi3ework fi3ework commented May 12, 2026

Copy link
Copy Markdown
Member

Summary

Browser-mode e2e tests run rstest as a subprocess via runBrowserCli and siblings, so any Rsbuild/Rspack build warning or Node deprecation lands inside cli.stdout / cli.stderr and is otherwise silently swallowed by the parent test runner — the e2e CI log on main shows zero Critical dependency lines today even though every browser-mode test actually emits it.

This PR decorates expectExecSuccess returned by the three browser-mode helpers (runBrowserCli, runBrowserWatchCli, runBrowserCliWithCwd) so that on success it additionally scans the captured CLI output for framework-warning markers:

  • Build warning: (Rsbuild)
  • Critical dependency: (rspack / webpack)
  • DeprecationWarning: (Node)
  • [MODULE_TYPELESS_PACKAGE_JSON] (Node ESM loader)

Any hit fails the test with the offending lines included in the error message. The helper expectNoFrameworkWarnings(cli) is also exported so watch-mode and other custom flows can call it explicitly.

This turns silent regressions like an await import(<var>) dynamic specifier losing its webpackIgnore magic comment into explicit, debuggable test failures.

Expectation

CI is expected to fail on this PR — the regression that #1244 fixes is still present on main, so every browser-mode test currently produces three Build warning: Critical dependency lines per build. After #1244 lands and the dist is rebuilt, this assertion turns green and protects against future recurrence.

Refs: #1244

Test plan

@github-actions

github-actions Bot commented May 12, 2026

Copy link
Copy Markdown

Rsdoctor Bundle Diff Analysis

Found 12 projects in monorepo, 0 projects with changes.

📊 Quick Summary
Project Total Size Change
adapter-rsbuild 3.6 KB 0
adapter-rslib 24.6 KB 0
adapter-rspack 7.7 KB 0
browser 2.0 MB 0
browser-react 3.7 KB 0
browser-ui 803.5 KB 0
coverage-istanbul 9.6 KB 0
core/browser 970.0 KB 0
core/loaders 869.0 B 0
core/main 1.6 MB 0
vscode/extension 58.9 MB 0
vscode/worker 14.4 KB 0

Generated by Rsdoctor GitHub Action

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7086041268

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .github/workflows/test.yml Outdated
@fi3ework fi3ework force-pushed the ci/fail-on-warning branch from 3fd45d8 to 864b12f Compare May 12, 2026 08:55
@fi3ework fi3ework changed the title ci: fail tests on warning or deprecation output test(e2e): assert no framework warnings in browser-mode CLI output May 12, 2026
@fi3ework fi3ework force-pushed the ci/fail-on-warning branch from 864b12f to fcc664b Compare May 12, 2026 09:27
@fi3ework fi3ework enabled auto-merge (squash) May 12, 2026 09:27
Browser-mode e2e tests run rstest as a subprocess via `runBrowserCli` &
siblings, so any Rsbuild/Rspack build warning or Node deprecation lands
in `cli.stdout`/`cli.stderr` and is otherwise silently swallowed by the
parent test runner.

Decorate `expectExecSuccess` returned by the three browser-mode helpers
to additionally scan the captured CLI output for framework warning
markers (`Build warning:`, `Critical dependency:`, `DeprecationWarning:`,
`MODULE_TYPELESS_PACKAGE_JSON`). Any hit fails the test with the
offending lines included in the message.

This turns regressions like an `await import(<var>)` dynamic specifier
losing its `webpackIgnore` magic comment into explicit, debuggable test
failures instead of invisible noise.

Refs: #1244
@fi3ework fi3ework force-pushed the ci/fail-on-warning branch from fcc664b to 7324cb4 Compare May 12, 2026 11:00
@fi3ework fi3ework merged commit 2708045 into main May 12, 2026
18 checks passed
@fi3ework fi3ework deleted the ci/fail-on-warning branch May 12, 2026 12:16
@9aoy 9aoy mentioned this pull request May 18, 2026
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.

1 participant