Skip to content

test: replace webpack with rspack in test files - #93

Merged
chenjiahan merged 1 commit into
mainfrom
test_replace_0303
Mar 3, 2026
Merged

chenjiahan merged 1 commit into
mainfrom
test_replace_0303

Conversation

@chenjiahan

Copy link
Copy Markdown
Member

Update test files to use rspack instead of webpack for consistency with the project's tooling. This change affects multiple test files across different test suites, ensuring all tests use the same bundler implementation.

Copilot AI review requested due to automatic review settings March 3, 2026 03:13
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request standardizes the bundler used within the project's end-to-end test files by migrating from Webpack to Rspack. This change ensures that the test environment accurately reflects the project's chosen build tool, improving consistency and reducing potential discrepancies between development and testing setups.

Highlights

  • Bundler Replacement: Replaced all instances of webpack with rspack in test files to align with the project's tooling and ensure consistency.
  • Import Modernization: Updated the import statement for @rspack/core from a default import (const webpack = require(...)) to a named import (const { rspack } = require(...)) across all affected test files.
  • Test Suite Consistency: Ensured that all e2e test suites now utilize rspack for compilation and related functionalities, including HotModuleReplacementPlugin and EntryPlugin.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • tests/e2e/allowed-hosts.test.js
    • Updated @rspack/core import to use named rspack export
    • Replaced webpack compiler calls with rspack
  • tests/e2e/api.test.js
    • Updated @rspack/core import to use named rspack export
    • Replaced webpack compiler calls with rspack
    • Updated webpack.HotModuleReplacementPlugin to rspack.HotModuleReplacementPlugin
  • tests/e2e/app.test.js
    • Updated @rspack/core import to use named rspack export
    • Replaced webpack compiler calls with rspack
  • tests/e2e/built-in-routes.test.js
    • Updated @rspack/core import to use named rspack export
    • Replaced webpack compiler calls with rspack
  • tests/e2e/client-reconnect.test.js
    • Updated @rspack/core import to use named rspack export
    • Replaced webpack compiler calls with rspack
  • tests/e2e/client.test.js
    • Updated @rspack/core import to use named rspack export
    • Replaced webpack compiler calls with rspack
  • tests/e2e/compress.test.js
    • Updated @rspack/core import to use named rspack export
    • Replaced webpack compiler calls with rspack
  • tests/e2e/entry.test.js
    • Updated @rspack/core import to use named rspack export
    • Replaced webpack compiler calls with rspack
    • Updated webpack.EntryPlugin to rspack.EntryPlugin
  • tests/e2e/headers.test.js
    • Updated @rspack/core import to use named rspack export
    • Replaced webpack compiler calls with rspack
  • tests/e2e/history-api-fallback.test.js
    • Updated @rspack/core import to use named rspack export
    • Replaced webpack compiler calls with rspack
  • tests/e2e/host.test.js
    • Updated @rspack/core import to use named rspack export
    • Replaced webpack compiler calls with rspack
  • tests/e2e/hot-and-live-reload.test.js
    • Updated @rspack/core import to use named rspack export
    • Replaced webpack compiler calls with rspack
    • Updated webpack.HotModuleReplacementPlugin to rspack.HotModuleReplacementPlugin
  • tests/e2e/ipc.test.js
    • Updated @rspack/core import to use named rspack export
    • Replaced webpack compiler calls with rspack
  • tests/e2e/lazy-compilation.test.js
    • Updated @rspack/core import to use named rspack export
    • Replaced webpack compiler calls with rspack
  • tests/e2e/logging.test.js
    • Updated @rspack/core import to use named rspack export
    • Replaced webpack compiler calls with rspack
  • tests/e2e/mime-types.test.js
    • Updated @rspack/core import to use named rspack export
    • Replaced webpack compiler calls with rspack
  • tests/e2e/module-federation.test.js
    • Updated @rspack/core import to use named rspack export
    • Replaced webpack compiler calls with rspack
  • tests/e2e/multi-compiler.test.js
    • Updated @rspack/core import to use named rspack export
    • Replaced webpack compiler calls with rspack
  • tests/e2e/on-listening.test.js
    • Updated @rspack/core import to use named rspack export
    • Replaced webpack compiler calls with rspack
  • tests/e2e/overlay.test.js
    • Updated @rspack/core import to use named rspack export
    • Replaced webpack compiler calls with rspack
  • tests/e2e/port.test.js
    • Updated @rspack/core import to use named rspack export
    • Replaced webpack compiler calls with rspack
  • tests/e2e/progress.test.js
    • Updated @rspack/core import to use named rspack export
    • Replaced webpack compiler calls with rspack
  • tests/e2e/range-header.test.js
    • Updated @rspack/core import to use named rspack export
    • Replaced webpack compiler calls with rspack
  • tests/e2e/server-and-client-transport.test.js
    • Updated @rspack/core import to use named rspack export
    • Replaced webpack compiler calls with rspack
  • tests/e2e/server.test.js
    • Updated @rspack/core import to use named rspack export
    • Replaced webpack compiler calls with rspack
  • tests/e2e/setup-exit-signals.test.js
    • Updated @rspack/core import to use named rspack export
    • Replaced webpack compiler calls with rspack
  • tests/e2e/setup-middlewares.test.js
    • Updated @rspack/core import to use named rspack export
    • Replaced webpack compiler calls with rspack
  • tests/e2e/static-directory.test.js
    • Updated @rspack/core import to use named rspack export
    • Replaced webpack compiler calls with rspack
  • tests/e2e/static-public-path.test.js
    • Updated @rspack/core import to use named rspack export
    • Replaced webpack compiler calls with rspack
  • tests/e2e/stats.test.js
    • Updated @rspack/core import to use named rspack export
    • Replaced webpack compiler calls with rspack
    • Updated webpack.version check to rspack.version
  • tests/e2e/target.test.js
    • Updated @rspack/core import to use named rspack export
    • Replaced webpack compiler calls with rspack
  • tests/e2e/watch-files.test.js
    • Updated @rspack/core import to use named rspack export
    • Replaced webpack compiler calls with rspack
  • tests/e2e/web-socket-communication.test.js
    • Updated @rspack/core import to use named rspack export
    • Replaced webpack compiler calls with rspack
  • tests/e2e/web-socket-server-url.test.js
    • Updated @rspack/core import to use named rspack export
    • Replaced webpack compiler calls with rspack
  • tests/e2e/web-socket-server.test.js
    • Updated @rspack/core import to use named rspack export
    • Replaced webpack compiler calls with rspack
  • tests/helpers/test-server.js
    • Updated @rspack/core import to use named rspack export
    • Replaced webpack compiler calls with rspack
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request consistently replaces the usage of webpack with rspack across numerous test files. The changes are straightforward, mainly involving search-and-replace operations on function calls and plugin instantiations. The refactoring is well-executed, ensuring that all tests now use rspack for bundling, which aligns with the project's tooling strategy. I've reviewed all the changes and found no issues; the migration appears to be correct and complete within the scope of the test files.

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.

Pull request overview

This PR updates the test suite to use the rspack API naming consistently instead of importing @rspack/core into a webpack variable, aligning tests with the project’s Rspack-based tooling.

Changes:

  • Replaced const webpack = require('@rspack/core') with const { rspack } = require('@rspack/core') across e2e tests and helpers.
  • Updated compiler creation from webpack(config) to rspack(config) throughout the affected tests.
  • Updated plugin references in tests (e.g., HMR/Entry plugins) to use rspack.*.

Reviewed changes

Copilot reviewed 36 out of 36 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tests/helpers/test-server.js Uses rspack(config) when creating the compiler for helper-based server setup.
tests/e2e/web-socket-server.test.js Switches compiler creation to rspack(config).
tests/e2e/web-socket-server-url.test.js Switches all compiler creation sites to rspack(config).
tests/e2e/web-socket-communication.test.js Switches compiler creation to rspack(config) in all cases.
tests/e2e/watch-files.test.js Switches compiler creation to rspack(config) across all suites.
tests/e2e/target.test.js Switches compiler creation to rspack(...) including multi-compiler cases.
tests/e2e/stats.test.js Uses rspack for compiler creation and version-gated test case logic.
tests/e2e/static-public-path.test.js Switches compiler creation to rspack(config) across suites.
tests/e2e/static-directory.test.js Switches compiler creation to rspack(config) across suites.
tests/e2e/setup-middlewares.test.js Switches compiler creation to rspack(config).
tests/e2e/setup-exit-signals.test.js Switches compiler creation to rspack(config).
tests/e2e/server.test.js Switches compiler creation to rspack(config) across server option suites.
tests/e2e/server-and-client-transport.test.js Switches compiler creation to rspack(...) across all transport cases.
tests/e2e/range-header.test.js Switches compiler creation to rspack(config).
tests/e2e/progress.test.js Switches compiler creation to rspack(reloadConfig).
tests/e2e/port.test.js Switches compiler creation to rspack(config).
tests/e2e/overlay.test.js Switches compiler creation to rspack(config) throughout overlay scenarios.
tests/e2e/on-listening.test.js Switches compiler creation to rspack(config).
tests/e2e/multi-compiler.test.js Switches compiler creation to rspack(...) across multi-compiler scenarios.
tests/e2e/module-federation.test.js Switches compiler creation to rspack(...) across module federation scenarios.
tests/e2e/mime-types.test.js Switches compiler creation to rspack(config) across suites.
tests/e2e/logging.test.js Switches compiler creation to rspack(...) for logging test matrix.
tests/e2e/lazy-compilation.test.js Switches compiler creation to rspack(...) in skipped lazy-compilation tests.
tests/e2e/ipc.test.js Switches compiler creation to rspack(config) across IPC scenarios.
tests/e2e/hot-and-live-reload.test.js Switches compiler creation to rspack(...) and updates HMR plugin usage accordingly.
tests/e2e/host.test.js Switches compiler creation to rspack(config) across host scenarios.
tests/e2e/history-api-fallback.test.js Switches compiler creation to rspack(config) across suites.
tests/e2e/headers.test.js Switches compiler creation to rspack(config) across suites.
tests/e2e/entry.test.js Switches compiler creation to rspack(...) and updates EntryPlugin usage accordingly.
tests/e2e/compress.test.js Switches compiler creation to rspack(config) across suites.
tests/e2e/client.test.js Switches compiler creation to rspack(...) across client option suites.
tests/e2e/client-reconnect.test.js Switches compiler creation to rspack(config) across reconnect scenarios.
tests/e2e/built-in-routes.test.js Switches compiler creation to rspack(config) for routes tests.
tests/e2e/app.test.js Switches compiler creation to rspack(config) in app integration tests.
tests/e2e/api.test.js Switches compiler creation to rspack(...) across API tests and manual configuration scenarios.
tests/e2e/allowed-hosts.test.js Switches compiler creation to rspack(config) across allowed-hosts matrix.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tests/e2e/lazy-compilation.test.js
Comment thread tests/helpers/test-server.js
@chenjiahan
chenjiahan merged commit df725db into main Mar 3, 2026
10 of 12 checks passed
@chenjiahan
chenjiahan deleted the test_replace_0303 branch March 3, 2026 03:35
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