test(e2e): capture build logs to make test logs clear#5437
Merged
chenjiahan merged 3 commits intomainfrom Jun 18, 2025
Merged
Conversation
✅ Deploy Preview for rsbuild ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Contributor
There was a problem hiding this comment.
Pull Request Overview
Captures build/dev logs through the build/dev helpers instead of manual proxyConsole and adds proper cleanup of helper processes.
- Removed all manual
proxyConsoleimports and calls, switching tests to usersbuild.logsor destructuredlogsfrombuild/dev. - Introduced
catchBuildErrorwhere tests expect failures and assertrsbuild.buildError. - Added
await rsbuild.close()orawait close()after assertions to clean up processes.
Reviewed Changes
Copilot reviewed 39 out of 39 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| e2e/cases/plugin-less/plugin-hints/index.test.ts | Removed proxyConsole, switched to build({ catchBuildError: true }), used rsbuild.logs and rsbuild.close(). |
| e2e/cases/plugin-api/plugin-transform-error-handle/index.test.ts | Swapped manual logs for rsbuild.logs, removed restore(), and added rsbuild.close(). |
| e2e/cases/performance/bundle-analyzer/index.test.ts | Replaced proxyConsole with rsbuild.logs, added rsbuild.close() in dev test. |
| e2e/cases/output/clean-dist-path/index.test.ts | Dropped proxyConsole, updated second test to use rsbuild.logs and rsbuild.close(). |
| e2e/cases/node-polyfill-tip/without-protocol/index.test.ts | Changed to build({ catchBuildError: true }), used rsbuild.logs, asserted rsbuild.buildError, and closed. |
| e2e/cases/node-polyfill-tip/with-protocol/index.test.ts | Same as above for with‐protocol case. |
| e2e/cases/module/exports-presence/index.test.ts | Converted to build({ catchBuildError: true }), used rsbuild.logs, checked buildError, and closed. |
| e2e/cases/lazy-compilation/port-placeholder/index.test.ts | Removed proxyConsole, switched to rsbuild.logs and rsbuild.close(). |
| e2e/cases/lazy-compilation/dynamic-import/index.test.ts | Same refactor: drop proxyConsole, use rsbuild.logs, and close. |
| e2e/cases/lazy-compilation/basic/index.test.ts | Identical changes for lazy-compilation basic case. |
| e2e/cases/javascript-api/custom-logger/index.test.ts | Removed manual logs, used rsbuild.logs, and cleaned up with rsbuild.close(). |
| e2e/cases/css/resolve-ts-paths/index.test.ts | Dropped try/finally restore(), used rsbuild.close(). |
| e2e/cases/css/nested-npm-import/index.test.ts | Removed proxyConsole, replaced logs with rsbuild.logs, and closed. |
| e2e/cases/css/import-common-css/index.test.ts | Same refactor: rsbuild.logs and rsbuild.close(). |
| e2e/cases/css/enable-experiments-css/index.test.ts | Updated both tests to use rsbuild.logs and call rsbuild.close(). |
| e2e/cases/config/stats-options/index.test.ts | Swapped to rsbuild.logs in both tests and added rsbuild.close(). |
| e2e/cases/config/stats-module-trace/index.test.ts | Added catchBuildError, used rsbuild.logs, asserted buildError, and closed. |
| e2e/cases/config/rspack-config-validate/index.test.ts | Refactored both cases to use rsbuild.logs, removed restore(), and closed. |
| e2e/cases/config/inspect-config/debug.test.ts | First test destructures close, second uses rsbuild.close(), and both use rsbuild.logs. |
| e2e/cases/alias/legacy-alias/index.test.ts | Removed proxyConsole, switched to rsbuild.logs, and added rsbuild.close(). |
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
proxyConsoleby default in thedevandbuildtest helpers.Checklist