test(e2e): assert no framework warnings in browser-mode CLI output#1242
Merged
Conversation
Rsdoctor Bundle Diff AnalysisFound 12 projects in monorepo, 0 projects with changes. 📊 Quick Summary
Generated by Rsdoctor GitHub Action |
There was a problem hiding this comment.
💡 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".
3fd45d8 to
864b12f
Compare
8 tasks
864b12f to
fcc664b
Compare
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
fcc664b to
7324cb4
Compare
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Browser-mode e2e tests run rstest as a subprocess via
runBrowserCliand siblings, so any Rsbuild/Rspack build warning or Node deprecation lands insidecli.stdout/cli.stderrand is otherwise silently swallowed by the parent test runner — the e2e CI log onmainshows zeroCritical dependencylines today even though every browser-mode test actually emits it.This PR decorates
expectExecSuccessreturned 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 itswebpackIgnoremagic 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 threeBuild warning: Critical dependencylines per build. After #1244 lands and the dist is rebuilt, this assertion turns green and protects against future recurrence.Refs: #1244
Test plan
mainpost-fix(core): split taskContext to remove node:async_hooks from browser bundle #1244, all browser-mode e2e jobs passe2e/browser-mode/basic.test.tsraises `Expected no framework warnings in CLI output, found: ...` with the threeCritical dependencylines surfaced