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.

9aoy and others added 4 commits January 15, 2026 17:53
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@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 <175728472+Copilot@users.noreply.github.com>

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

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

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

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* fix: lint

* docs: update -t

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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 <175728472+Copilot@users.noreply.github.com>

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

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

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

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* fix: lint

* docs: update -t

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@9aoy 9aoy restored the test-filter branch January 19, 2026 03:26
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.

3 participants