-
-
Notifications
You must be signed in to change notification settings - Fork 757
test: support filter test by absolute path #12749
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
✅ Deploy Preview for rspack ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this 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
describeByWalkto 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.
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>
Rsdoctor Bundle Diff AnalysisFound 5 projects in monorepo, 5 projects with changes. 📊 Quick Summary
📋 Detailed Reports (Click to expand)📁 react-10kPath:
📁 react-1kPath:
📁 react-5kPath:
📁 ui-componentsPath:
📁 romePath:
Generated by Rsdoctor GitHub Action |
📦 Binary Size-limit
🙈 Size remains the same at 48.03MB |
|
Can we update the contribution guide too? |
* 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>
* 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>
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-jsonwill run all tests in theerror-in-jsontest case.pnpm test -t /Users/rspack/tests/rspack-test/hotCases/jsonwill run all test cases in thejsondirectory.pnpm test -t /Users/rspack/tests/rspack-test/hotCaseswill run all test cases in thehotCasesdirectory.Related links
Checklist