Skip to content

Conversation

@9aoy
Copy link
Contributor

@9aoy 9aoy commented Jan 15, 2026

Summary

support filter tests by absolute path via pnpm test -t ${absoluteTestCaseDir} / pnpm test -t ${absoluteTestDir}.

eg:

  • pnpm test -t /Users/rspack/tests/rspack-test/hotCases/json/error-in-json will run all tests in the error-in-json test case.
  • pnpm test -t /Users/rspack/tests/rspack-test/hotCases/json will run all test cases in the json directory.
  • pnpm test -t /Users/rspack/tests/rspack-test/hotCases will run all test cases in the hotCases directory.
image

Related links

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

@9aoy 9aoy requested a review from LingyuCoder as a code owner January 15, 2026 09:46
Copilot AI review requested due to automatic review settings January 15, 2026 09:46
@netlify
Copy link

netlify bot commented Jan 15, 2026

Deploy Preview for rspack ready!

Name Link
🔨 Latest commit 9cf0a7d
🔍 Latest deploy log https://app.netlify.com/projects/rspack/deploys/6968cc3831769a0008d64415
😎 Deploy Preview https://deploy-preview-12749--rspack.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

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

@github-actions github-actions bot added the team The issue/pr is created by the member of Rspack. label Jan 15, 2026
Copy link
Contributor

Copilot AI left a comment

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 adds support for filtering tests by absolute path when running the test suite via pnpm test -t ${absoluteTestCasePath}. The change enables developers to specify an absolute path to a specific test case directory for more targeted test execution.

Changes:

  • Extracts testFilter logic to a shared variable in rstest.config.ts for reuse
  • Modifies describeByWalk to detect when testFilter contains an absolute path and adjusts test suite names accordingly
  • Updates Cache.test.js to use absolute path parameter instead of a string identifier
  • Changes the reporter to 'verbose' when a testFilter is specified for better debugging output

Reviewed changes

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

File Description
tests/rspack-test/rstest.config.ts Extracts testFilter parsing logic and passes it as environment variable; changes reporter to verbose when filtering
packages/rspack-test-tools/src/helper/directory.ts Adds logic to detect absolute paths in testFilter and adjust suite names to support absolute path filtering
tests/rspack-test/Cache.test.js Changes first parameter from string "cache" to absolute path for consistency with other test files

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

@github-actions
Copy link
Contributor

github-actions bot commented Jan 15, 2026

Rsdoctor Bundle Diff Analysis

Found 5 projects in monorepo, 5 projects with changes.

📊 Quick Summary
Project Total Size Change
react-10k 5.7 MB -
react-1k 825.4 KB -
react-5k 2.7 MB -
ui-components 2.1 MB -
rome 984.3 KB -
📋 Detailed Reports (Click to expand)

📁 react-10k

Path: ../build-tools-performance/cases/react-10k/dist/rsdoctor-data.json

⚠️ No baseline data found - Unable to perform comparison analysis

Metric Current Baseline Change
📊 Total Size 5.7 MB - -
📄 JavaScript 5.7 MB - -
🎨 CSS 21.0 B - -
🌐 HTML 0 B - -
📁 Other Assets 0 B - -

📁 react-1k

Path: ../build-tools-performance/cases/react-1k/dist/rsdoctor-data.json

⚠️ No baseline data found - Unable to perform comparison analysis

Metric Current Baseline Change
📊 Total Size 825.4 KB - -
📄 JavaScript 825.4 KB - -
🎨 CSS 0 B - -
🌐 HTML 0 B - -
📁 Other Assets 0 B - -

📁 react-5k

Path: ../build-tools-performance/cases/react-5k/dist/rsdoctor-data.json

⚠️ No baseline data found - Unable to perform comparison analysis

Metric Current Baseline Change
📊 Total Size 2.7 MB - -
📄 JavaScript 2.7 MB - -
🎨 CSS 21.0 B - -
🌐 HTML 0 B - -
📁 Other Assets 0 B - -

📁 ui-components

Path: ../build-tools-performance/cases/ui-components/dist/rsdoctor-data.json

⚠️ No baseline data found - Unable to perform comparison analysis

Metric Current Baseline Change
📊 Total Size 2.1 MB - -
📄 JavaScript 2.0 MB - -
🎨 CSS 83.0 KB - -
🌐 HTML 0 B - -
📁 Other Assets 0 B - -

📁 rome

Path: ../build-tools-performance/cases/rome/dist/rsdoctor-data.json

⚠️ No baseline data found - Unable to perform comparison analysis

Metric Current Baseline Change
📊 Total Size 984.3 KB - -
📄 JavaScript 984.3 KB - -
🎨 CSS 0 B - -
🌐 HTML 0 B - -
📁 Other Assets 0 B - -

Generated by Rsdoctor GitHub Action

@github-actions
Copy link
Contributor

github-actions bot commented Jan 15, 2026

📦 Binary Size-limit

Comparing 9cf0a7d to chore(lint): bump @rslint/core to 0.2.0 and enable default-param-last rule (#12746) by senze.fan

🙈 Size remains the same at 48.03MB

chenjiahan
chenjiahan previously approved these changes Jan 15, 2026
@chenjiahan
Copy link
Member

Can we update the contribution guide too?

@9aoy 9aoy requested a review from chenjiahan January 15, 2026 11:56
@9aoy 9aoy enabled auto-merge (squash) January 15, 2026 11:57
@chenjiahan chenjiahan disabled auto-merge January 15, 2026 12:44
@chenjiahan chenjiahan merged commit 476c9a0 into main Jan 15, 2026
49 of 51 checks passed
@chenjiahan chenjiahan deleted the test-filter branch January 15, 2026 12:45
LingyuCoder pushed a commit that referenced this pull request Jan 16, 2026
* test: support filter test by absolute path

* Update packages/rspack-test-tools/src/helper/directory.ts

Co-authored-by: Copilot <[email protected]>

* Update packages/rspack-test-tools/src/helper/directory.ts

Co-authored-by: Copilot <[email protected]>

* Update tests/rspack-test/Cache.test.js

Co-authored-by: Copilot <[email protected]>

* fix: lint

* docs: update -t

---------

Co-authored-by: Copilot <[email protected]>
chenjiahan pushed a commit that referenced this pull request Jan 16, 2026
* test: support filter test by absolute path

* Update packages/rspack-test-tools/src/helper/directory.ts

Co-authored-by: Copilot <[email protected]>

* Update packages/rspack-test-tools/src/helper/directory.ts

Co-authored-by: Copilot <[email protected]>

* Update tests/rspack-test/Cache.test.js

Co-authored-by: Copilot <[email protected]>

* fix: lint

* docs: update -t

---------

Co-authored-by: Copilot <[email protected]>
@9aoy 9aoy restored the test-filter branch January 19, 2026 03:26
hardfist added a commit that referenced this pull request Feb 5, 2026
* feat: treeshake share

* fix(module-federation): correct shared module name and optimize tree shaking

fix incorrect module name in shared config and test cases
change async process_module to sync using block_on for better performance
update shared exports optimization to handle side effects properly

* feat(module-federation): add treeshakeSharedExcludedPlugins option

* chore: add watchRun

* fix(shared-modules): handle undefined moduleToHandlerMapping and prevent tree-shaking

Add fallback for undefined moduleToHandlerMapping in shared container entry
Include additional plugins in filter list and prevent tree-shaking of shared modules by adding console logs when collectShared is true

* test(container-1-5): add ui-lib package for treeshake shared infer strategy

* fix(shared_used_exports): handle scoped package names in shared exports
refactor(node_binding): remove redundant exports in wasi files

* chore: update critical file

* feat(module-federation): add target and plugins to build info for treeshaking

Add target and plugins fields to build info when treeshaking is enabled in module federation. Also rename 'reshake' to 'reShake' for consistency across the codebase. These changes support better treeshaking analysis and configuration.

* docs: update field

* feat: add treeshakeSharedPlugins

* fix: lint

* fix: lockfile

* fix: lint

* chore: rename config

* chore(deps): update patch npm dependencies (#12647)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update patch crates (#12646)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore: run ci/eco-ci/eco-benchmark on v2 branch (#12650)

* fix: report error when access module_graph in loader (#12639)

* fix: report error when access module_graph in loader

* Apply suggestions from code review

Co-authored-by: Copilot <[email protected]>

---------

Co-authored-by: Copilot <[email protected]>

* feat(rstest): add preserveNewUrl option to keep new URL untouched (#12632)

* feat(rstest): add preserveNewUrl option to keep new URL untouched

* fix: format Rust code with rustfmt

* fix(lint): enable @typescript-eslint/await-thenable rule (#12644)

* fix(lint): enable await-thenable rule and fix violation

- Enable @typescript-eslint/await-thenable rule (off -> error)
- Remove unnecessary await on syncTraceEvent() which returns void

* Update rslint.json

---------

Co-authored-by: neverland <[email protected]>

* refactor: afterCodeGeneration hook use read only compilation ref (#12655)

* fix(lint): enable @typescript-eslint/require-await rule (#12664)

fix(lint): enable require-await rule and fix violations

- Enable @typescript-eslint/require-await rule (off -> error)
- FileSystem.ts: Add missing return for Promise, remove async
- SubresourceIntegrityPlugin.ts: Use Promise.resolve() instead of async
- browser/service.ts: Remove async from function that only throws
- loader-runner/worker.ts: Remove async from .then/.catch callbacks

* chore(deps): update github-actions (#12645)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* fix(lint): enable @typescript-eslint/return-await rule (#12665)

* refactor: make compilation readonly for runtimeModule hook (#12670)

* feat: add constructor name for JS runtime modules (#12673)

feat: add constructor name for JS runtime module

* fix: incremental rebuild no code generation entry panic (#12643)

* fix: incremental rebuild bug

* add test case

* fix: ci

* refactor: unify artifact clear logic (#12677)

* refactor: use DerfOpt's take/replace assist artifact mutation (#12659)

* refactor: remove Default trait of DerefOption
* refactor: `replace` is better than `insert`

* feat: rspack_cacheable context expose project root (#12685)

* feat: rspack_cacheable context expose project root

* fix: comment

* feat: rspack_cacheable add portable path & portable string (#12688)

feat: add portable path & portable string

* fix: inlined export invalid syntax comment (#12681)

* feat: add `requireAlias` option to control require variable renaming (#12686)

* feat: add requireRename option to control require variable renaming

* Update packages/rspack/src/config/types.ts

Co-authored-by: Copilot <[email protected]>

* Update tests/rspack-test/configCases/parsing/renaming-disabled/index.js

Co-authored-by: Copilot <[email protected]>

* rename

* rename

---------

Co-authored-by: Copilot <[email protected]>

* fix(test): flaky test due to calling toJSON while hot updating (#12694)

* feat: impl `sync_trace` for `logger` tracing layer (#12687)

* Sync node events for logger tracing

* Align sync_trace

* Remove unless info

* Cargo shear

* Use one writer

* Filter JavaScript

* Handle timestamps

* Clippy

* Clippy

* feat: add warning when requireAlias is disabled (#12700)

* refactor: rename tree shaking field name

* revert: "feat: add warning when requireAlias is disabled" (#12702)

Revert "feat: add warning when requireAlias is disabled (#12700)"

This reverts commit eb5635c.

* feat: use rspack-vue-loader to support Vue hot update (#12698)

feat: use rspack-vue-loader to support hotupdate

* chore: update artificat

* chore: replace async processAssets hooks with sync versions

* fix: `environments.importMetaDirnameAndFilename` not work (#12708)

fix: `environments.importMetaDirnameAndFilename` should work

* fix: dynamic entry panic when disable build cache (#12696)

* fix(context-replacement): only apply changes when regex matches (#12657)

fix(ContextReplacementPlugin): only apply changes when regex matches

The plugin was applying transformations (recursive, regExp, critical) to
all require.context() calls regardless of whether the configured regex
pattern matched the request. This fix ensures all transformations only
apply when the regex successfully matches.

Closes #12656

* docs: add missed doc

* fix: remove ueless dep

* chore: update lock file

* fix(mf): handle missing chunk gracefully and improve expose chunk name logic (#12709)

* fix(type): runtimeModule.source (#12713)

* fix(type): runtimeModule.source

* fix: lint

* fix: lint

* chore: release 1.7.2 (#12710)

Release 0.7.2

[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]

Generated by cargo-workspaces

* chore(deps): update dependency @rspack/plugin-react-refresh to ^1.6.0 (#12718)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update dependency @shikijs/transformers to ^3.21.0 (#12719)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update patch crates (#12716)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* test: skip recover-from-error/delete-file in watchCases (#12726)

* feat: support portable cache and disable by default (#12680)

* feat: support portable cache

* feat: disable portable cache by default

* fix: rename reShake to secondaryTreeShaking

* chore: update artificat

* test: use Rstest projects to define tests (#12729)

* test: use rstest projects

* test: update

* test: output.module

* test: update

* chore(deps): update patch npm dependencies (#12717)

* chore(deps): update patch npm dependencies

* fix: downgrade MF

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: neverland <[email protected]>

* refactor: move pass into separate folder and driven by run_passes (#12735)

* chore: add rspack_passes.md

* refactor: move pass into separate folder and drive by run_passes

* chore: use function

* refactor: move more into run_passes

* chore: fix stats logging

* chore: fix stats.logging

* refactor(lazy-compilation): use POST request to transfer  ids of active modules (#12678)

* refactor: use post transfer module ids

* test: skip lazy active method

* test: add lazy post request help

* test: add large module id container

* test: add case introduction

* refactor: remove about controller

* test: we are using post method now

* refactor: rename

* fix body parser (vibe-kanban 09797829)

1. 如果其他中间件一个解析好了body,并挂载在req.body 上的花就直直接使用 req.body
2. packages/rspack/src/builtin-plugin/lazy-compilation/middleware.ts body 解析的时候不能简单的使用 string 的拼接,需要考虑多字节符号的截断的问题。

* refactor read module ids from body (vibe-kanban a7874ac1)

packages/rspack/src/builtin-plugin/lazy-compilation/middleware.ts 当req.body 非空时,直接假body中时一组 module ids,如果没有 body 自行拼接完,之后也 parse json string,返回 module ids 数组

* refactor: downgrading to lower web api

* test: ✅ add lazy compilation active cors cases

* chore: update test case doc

* fix: we all need cors header no matter is simple request or not

* refactor:delete cors header setting

* refactor: set cors header should set by user

* Update packages/rspack/hot/lazy-compilation-web.js

Co-authored-by: neverland <[email protected]>

* test: fix case name

* chore: api-extract update

* fix: memory leak of requst listeners

* refactor: remove event source handle logic

* fix: jsdom XMLHTTPRequets need strict cors header

* refactor: node lazy compilation client use post too

---------

Co-authored-by: neverland <[email protected]>

* refactor: move logger into pass and reorg some passes (#12742)

* refactor: move logger into pass and reorg some passes

* chore: fix bench check

* chore(lint): bump @rslint/core to 0.2.0 and enable default-param-last rule (#12746)

* chore(deps): bump @rslint/core to 0.2.0 and update rslint.json

* fix(lint): enable @typescript-eslint/default-param-last rule

* test: support filter test by absolute path (#12749)

* test: support filter test by absolute path

* Update packages/rspack-test-tools/src/helper/directory.ts

Co-authored-by: Copilot <[email protected]>

* Update packages/rspack-test-tools/src/helper/directory.ts

Co-authored-by: Copilot <[email protected]>

* Update tests/rspack-test/Cache.test.js

Co-authored-by: Copilot <[email protected]>

* fix: lint

* docs: update -t

---------

Co-authored-by: Copilot <[email protected]>

* refactor: use newtype for alias artifact (#12754)

* chore: bump `swc_core` from 54 to 55 (#12758)

* chore: bump swc

* chore: bump swc exp

* chore: cargo codegen

* refactor: move all artifacts together (#12755)

* chore: limit threads for codspeed benchmark (#12763)

Limit threads

* chore(deps): update dependency cspell to ^9.6.0 (#12768)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update dependency emnapi to ^1.8.1 (#12769)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update dependency memfs to v4.53.0 (#12770)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* refactor: use compilation readonly ref in codegen optimization hook (#12743)

* refactor: use compilation readonly ref in code generation optimization hook

* chore: debug bench ci

* fix: 🐛 use offical codseed action

* Debug ci

* Remove debugger

* Limit tokio and rayon worker threads

* Revert "Limit tokio and rayon worker threads"

This reverts commit 10fe6ac.

* Update crates/rspack_plugin_progress/src/lib.rs

Co-authored-by: Copilot <[email protected]>

---------

Co-authored-by: CPunisher <[email protected]>
Co-authored-by: Copilot <[email protected]>

* fix(browser): update worker format and add e2e test (#12747)

* fix: remove lazyCompilationMiddleware

* chore: change worker entry to iife

* chore: add e2e test

* chore: fix format

* fix: add await for e2e

* fix: remove unused imports

* chore: fix ci yml

* chore: fix ci WASM env injection

* fix: update shared global name

* perf: reuse container plugin

* chore: fix merge conflict

* chore: use official version and update docs

* chore: fix cargo clippy

* chore: bump

* workflow: revert ci

* ci: add CodSpeed performance analysis action

Add GitHub action for continuous benchmarking with CodSpeed. The action supports multiple measurement modes and instruments, including MongoDB instrumentation and caching for faster runs. Includes validation for required inputs and custom runner installation.

* chore: revert cacahe implementation

* chore: use get_referenced_exports

* chore: revert esm depnedency change

* chore: revert esm_import_specifier_dependency change

* refactor(mf): simplify runtime module implementations

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: harpsealjs <[email protected]>
Co-authored-by: hardfist <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Max <[email protected]>
Co-authored-by: Tu Shaokun <[email protected]>
Co-authored-by: neverland <[email protected]>
Co-authored-by: pshu <[email protected]>
Co-authored-by: jinrui <[email protected]>
Co-authored-by: Gengkun <[email protected]>
Co-authored-by: CPunisher <[email protected]>
Co-authored-by: 9aoy <[email protected]>
Co-authored-by: neverland <[email protected]>
Co-authored-by: Cong-Cong Pan <[email protected]>
Co-authored-by: Agney Menon <[email protected]>
Co-authored-by: Fy <[email protected]>
Co-authored-by: senze.fan <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

team The issue/pr is created by the member of Rspack.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants