refactor: cache test case support NEXT_MOVE_DIR_START#12359
refactor: cache test case support NEXT_MOVE_DIR_START#12359jerrykingxyz merged 3 commits intomainfrom
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.
Pull request overview
This PR refactors the cache test infrastructure to support NEXT_MOVE_DIR_START, a new test helper that enables testing portable cache scenarios where the build directory is relocated between compiler runs. The change includes refactoring the cache options generation logic and adding a method to move the temporary directory while updating all related file paths.
Key changes:
- Added
NEXT_MOVE_DIR_STARTfunction to test cache behavior when moving directories - Refactored
defaultOptionsandoverrideOptionsinto a singlegenerateOptionsfunction - Added
moveTempDir()method toHotUpdatePluginfor directory relocation - Moved
MAX_UPDATE_INDEXconstant from cache.ts to plugin.ts for better organization
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
tests/rspack-test/cacheCases/portable/basic/rspack.config.js |
New test configuration with immutablePaths to verify portable cache behavior |
tests/rspack-test/cacheCases/portable/basic/index.js |
Test case demonstrating NEXT_MOVE_DIR_START functionality with cache invalidation |
tests/rspack-test/cacheCases/portable/basic/file.js |
Test file with three versions separated by '---' delimiters |
packages/rspack-test-tools/src/helper/hot-update/plugin.ts |
Added moveTempDir() method and MAX_UPDATE_INDEX guard in goNext() |
packages/rspack-test-tools/src/case/cache.ts |
Refactored options generation, added nextMoveDirStart function, and extracted checkStats helper |
Comments suppressed due to low confidence (1)
packages/rspack-test-tools/src/helper/hot-update/plugin.ts:120
- Character '/' is repeated in the same character class.
this.tempDir.replace(/(___[0-9]+)?[//]*$/, "") + "___" + this.updateIndex;
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Rsdoctor Bundle Diff AnalysisFound 5 project(s) in monorepo. 📁 react-10kPath:
📁 react-1kPath:
📁 react-5kPath:
📁 romePath:
📁 ui-componentsPath:
Generated by Rsdoctor GitHub Action |
📦 Binary Size-limit
🙈 Size remains the same at 47.71MB |
CodSpeed Performance ReportMerging #12359 will not alter performanceComparing Summary
|
Summary
Cache test cases support
NEXT_MOVE_DIR_STARTfor testing Portable cache.Relevant RFC: #12218
Related links
Checklist