Skip to content

test: migrate to Rstest#4871

Merged
2heal1 merged 9 commits into
module-federation:mainfrom
chenjiahan:migrate_to_rstest_0706
Jul 7, 2026
Merged

test: migrate to Rstest#4871
2heal1 merged 9 commits into
module-federation:mainfrom
chenjiahan:migrate_to_rstest_0706

Conversation

@chenjiahan

Copy link
Copy Markdown
Member

Description

Migrate package-level Vitest test suites to Rstest and update the related test configuration.

This improves test performance:

Runner Samples Avg wall time Avg Turbo time
Vitest 14.92s, 14.27s, 14.19s 14.46s 14.164s
Rstest 12.71s, 12.30s, 12.09s 12.37s 11.852s

That is a reduction of about 2.09s wall time (-14.5%) and 2.31s Turbo time (-16.3%) across repeated full test runs.

Other notes:

  • Uses latest available @rstest/core.
  • Replaces migrated Vitest APIs with Rstest APIs.
  • Uses Rsbuild framework plugins where needed, including @rsbuild/plugin-react.
  • Uses rstest-fetch-mock for fetch mocking instead of hand-rolled fetch stubs.
  • Keeps Vitest only where non-migrated app tests still depend on it.

Types of changes

  • Docs change / refactoring / dependency upgrade
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

Checklist

  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • I have updated the documentation.

@netlify

netlify Bot commented Jul 7, 2026

Copy link
Copy Markdown

Deploy Preview for module-federation-docs ready!

Name Link
🔨 Latest commit 9e66034
🔍 Latest deploy log https://app.netlify.com/projects/module-federation-docs/deploys/6a4c7c36b299250008ed2a90
😎 Deploy Preview https://deploy-preview-4871--module-federation-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@changeset-bot

changeset-bot Bot commented Jul 7, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 9e66034

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@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: 87e2a752bb

ℹ️ 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 packages/runtime/__tests__/global.spec.ts
@pkg-pr-new

pkg-pr-new Bot commented Jul 7, 2026

Copy link
Copy Markdown

Open in StackBlitz

@module-federation/devtools

pnpm add https://pkg.pr.new/@module-federation/devtools@9e66034

@module-federation/cli

pnpm add https://pkg.pr.new/@module-federation/cli@9e66034

create-module-federation

pnpm add https://pkg.pr.new/create-module-federation@9e66034

@module-federation/dts-plugin

pnpm add https://pkg.pr.new/@module-federation/dts-plugin@9e66034

@module-federation/enhanced

pnpm add https://pkg.pr.new/@module-federation/enhanced@9e66034

@module-federation/error-codes

pnpm add https://pkg.pr.new/@module-federation/error-codes@9e66034

@module-federation/esbuild

pnpm add https://pkg.pr.new/@module-federation/esbuild@9e66034

@module-federation/managers

pnpm add https://pkg.pr.new/@module-federation/managers@9e66034

@module-federation/manifest

pnpm add https://pkg.pr.new/@module-federation/manifest@9e66034

@module-federation/metro

pnpm add https://pkg.pr.new/@module-federation/metro@9e66034

@module-federation/metro-plugin-rnc-cli

pnpm add https://pkg.pr.new/@module-federation/metro-plugin-rnc-cli@9e66034

@module-federation/metro-plugin-rnef

pnpm add https://pkg.pr.new/@module-federation/metro-plugin-rnef@9e66034

@module-federation/metro-plugin-rock

pnpm add https://pkg.pr.new/@module-federation/metro-plugin-rock@9e66034

@module-federation/modern-js

pnpm add https://pkg.pr.new/@module-federation/modern-js@9e66034

@module-federation/modern-js-v3

pnpm add https://pkg.pr.new/@module-federation/modern-js-v3@9e66034

@module-federation/native-federation-tests

pnpm add https://pkg.pr.new/@module-federation/native-federation-tests@9e66034

@module-federation/native-federation-typescript

pnpm add https://pkg.pr.new/@module-federation/native-federation-typescript@9e66034

@module-federation/nextjs-mf

pnpm add https://pkg.pr.new/@module-federation/nextjs-mf@9e66034

@module-federation/node

pnpm add https://pkg.pr.new/@module-federation/node@9e66034

@module-federation/observability-plugin

pnpm add https://pkg.pr.new/@module-federation/observability-plugin@9e66034

@module-federation/playground

pnpm add https://pkg.pr.new/@module-federation/playground@9e66034

@module-federation/retry-plugin

pnpm add https://pkg.pr.new/@module-federation/retry-plugin@9e66034

@module-federation/rsbuild-plugin

pnpm add https://pkg.pr.new/@module-federation/rsbuild-plugin@9e66034

@module-federation/rspack

pnpm add https://pkg.pr.new/@module-federation/rspack@9e66034

@module-federation/rspress-plugin

pnpm add https://pkg.pr.new/@module-federation/rspress-plugin@9e66034

@module-federation/runtime

pnpm add https://pkg.pr.new/@module-federation/runtime@9e66034

@module-federation/runtime-core

pnpm add https://pkg.pr.new/@module-federation/runtime-core@9e66034

@module-federation/runtime-tools

pnpm add https://pkg.pr.new/@module-federation/runtime-tools@9e66034

@module-federation/sdk

pnpm add https://pkg.pr.new/@module-federation/sdk@9e66034

@module-federation/storybook-addon

pnpm add https://pkg.pr.new/@module-federation/storybook-addon@9e66034

@module-federation/third-party-dts-extractor

pnpm add https://pkg.pr.new/@module-federation/third-party-dts-extractor@9e66034

@module-federation/treeshake-frontend

pnpm add https://pkg.pr.new/@module-federation/treeshake-frontend@9e66034

@module-federation/treeshake-server

pnpm add https://pkg.pr.new/@module-federation/treeshake-server@9e66034

@module-federation/typescript

pnpm add https://pkg.pr.new/@module-federation/typescript@9e66034

@module-federation/utilities

pnpm add https://pkg.pr.new/@module-federation/utilities@9e66034

@module-federation/webpack-bundler-runtime

pnpm add https://pkg.pr.new/@module-federation/webpack-bundler-runtime@9e66034

@module-federation/bridge-react

pnpm add https://pkg.pr.new/@module-federation/bridge-react@9e66034

@module-federation/bridge-react-webpack-plugin

pnpm add https://pkg.pr.new/@module-federation/bridge-react-webpack-plugin@9e66034

@module-federation/bridge-shared

pnpm add https://pkg.pr.new/@module-federation/bridge-shared@9e66034

@module-federation/bridge-vue3

pnpm add https://pkg.pr.new/@module-federation/bridge-vue3@9e66034

@module-federation/inject-external-runtime-core-plugin

pnpm add https://pkg.pr.new/@module-federation/inject-external-runtime-core-plugin@9e66034

commit: 9e66034

@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: 654037200d

ℹ️ 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 packages/chrome-devtools/rstest.config.ts
@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Bundle Size Report

15 package(s) changed, 27 unchanged.

Package dist + ESM entry

Package Total dist (raw) Delta ESM gzip Delta
@module-federation/cli 26.3 kB no change 786 B no change
@module-federation/core 39.1 kB no change 173 B no change
@module-federation/devtools 668.2 kB no change 4.0 kB no change
@module-federation/enhanced 810.0 kB -22 B (-0.0%) 672 B no change
@module-federation/managers 70.0 kB no change 334 B no change
@module-federation/manifest 136.1 kB no change 182 B no change
@module-federation/metro-plugin-rnc-cli 0 B no change 314 B no change
@module-federation/native-federation-tests 93.1 kB -21 B (-0.0%) 745 B no change
@module-federation/native-federation-typescript 91.6 kB -21 B (-0.0%) 629 B no change
@module-federation/node 193.4 kB no change 217 B no change
@module-federation/playground 28.84 MB -668 B (-0.0%) 51.9 kB no change
@module-federation/runtime-core 287.7 kB -8 B (-0.0%) 477 B no change
@module-federation/storybook-addon 79.2 kB no change 100 B no change
@module-federation/third-party-dts-extractor 59.3 kB -21 B (-0.0%) 1.9 kB no change
@module-federation/utilities 110.6 kB no change 328 B no change

Bundle targets

Package Web bundle (gzip) Delta Node bundle (gzip) Delta
@module-federation/cli 2.3 kB -31 B (-1.3%) 2.3 kB -31 B (-1.3%)
@module-federation/core 1.1 kB -32 B (-2.9%) 1.0 kB -31 B (-2.9%)
@module-federation/devtools 30.4 kB -35 B (-0.1%) 30.4 kB -35 B (-0.1%)
@module-federation/enhanced 2.6 kB -44 B (-1.6%) 2.6 kB -44 B (-1.6%)
@module-federation/managers 2.4 kB -28 B (-1.1%) 2.4 kB -28 B (-1.1%)
@module-federation/manifest 6.1 kB -40 B (-0.6%) 6.1 kB -40 B (-0.6%)
@module-federation/metro-plugin-rnc-cli 411 B -25 B (-5.7%) 411 B -25 B (-5.7%)
@module-federation/native-federation-tests 1.5 kB no change 1.5 kB no change
@module-federation/native-federation-typescript 2.0 kB no change 2.0 kB no change
@module-federation/node 9.2 kB -28 B (-0.3%) 9.2 kB -28 B (-0.3%)
@module-federation/playground 48.0 kB no change 48.0 kB no change
@module-federation/runtime-core 15.3 kB no change 15.0 kB no change
@module-federation/storybook-addon 1.9 kB -24 B (-1.2%) 1.7 kB -24 B (-1.3%)
@module-federation/third-party-dts-extractor 1.2 kB no change 1.2 kB no change
@module-federation/utilities 2.6 kB -32 B (-1.2%) 2.6 kB -32 B (-1.2%)

Consumer scenarios

Scenario Web output (gzip) Delta Node output (gzip) Delta Gap (node-web) Delta
Enhanced remoteEntry 21.4 kB -21 B (-0.1%) 23.1 kB -23 B (-0.1%) +1.7 kB -2 B

Total dist (raw): 35.70 MB (-761 B (-0.0%))
Total ESM gzip: 131.2 kB (no change)
Total web bundle (gzip): 255.5 kB (-319 B (-0.1%))
Total node bundle (gzip): 257.7 kB (-318 B (-0.1%))
Tracked ./bundler entry gzip: 556 B (no change)
Tracked ./bundler web bundle (gzip): 4.8 kB (no change)
Tracked ./bundler node bundle (gzip): 4.8 kB (no change)

Bundle sizes are generated with rslib (Rspack). Package-root metrics preserve the historical report. Tracked subpath exports such as ./bundler are measured separately so ENV_TARGET-driven tree-shaking is visible. Bare imports are externalized to keep package-level sizes consistent, and assets are emitted as resources.

@chenjiahan chenjiahan requested a review from 2heal1 July 7, 2026 04:48
@2heal1 2heal1 merged commit 3ee98cd into module-federation:main Jul 7, 2026
23 checks passed
@2heal1 2heal1 mentioned this pull request Jul 8, 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.

2 participants