Skip to content

test: replace heavy filename_with_hash test with targeted hash fixtures#8597

Merged
graphite-app[bot] merged 1 commit intomainfrom
eliminate-filename-with-hash-test
Mar 9, 2026
Merged

test: replace heavy filename_with_hash test with targeted hash fixtures#8597
graphite-app[bot] merged 1 commit intomainfrom
eliminate-filename-with-hash-test

Conversation

@Boshen
Copy link
Member

@Boshen Boshen commented Mar 9, 2026

Summary

  • Remove filename_with_hash test that bundled all ~1,470 fixtures sequentially with hashed filenames, producing a 180KB / 6,629-line snapshot that changed on nearly every PR
  • Replace with 4 targeted hash fixtures: basic, code splitting, dynamic import, and content placeholder
  • ~25x faster (3.56s → 0.14s), net -6,600 lines

🤖 Generated with Claude Code

@netlify
Copy link

netlify bot commented Mar 9, 2026

Deploy Preview for rolldown-rs canceled.

Name Link
🔨 Latest commit a3c7162
🔍 Latest deploy log https://app.netlify.com/projects/rolldown-rs/deploys/69ae9cd2dec4920008ab2757

@Boshen Boshen marked this pull request as ready for review March 9, 2026 10:10
Copilot AI review requested due to automatic review settings March 9, 2026 10:10
Copy link
Member Author

Boshen commented Mar 9, 2026

Merge activity

  • Mar 9, 10:11 AM UTC: The merge label 'graphite: merge-when-ready' was detected. This PR will be added to the Graphite merge queue once it meets the requirements.
  • Mar 9, 10:11 AM UTC: Boshen added this pull request to the Graphite merge queue.
  • Mar 9, 10:20 AM UTC: Merged by the Graphite merge queue.

…es (#8597)

## Summary

- Remove `filename_with_hash` test that bundled all ~1,470 fixtures sequentially with hashed filenames, producing a 180KB / 6,629-line snapshot that changed on nearly every PR
- Replace with 4 targeted hash fixtures: basic, code splitting, dynamic import, and content placeholder
- ~25x faster (3.56s → 0.14s), net -6,600 lines

🤖 Generated with [Claude Code](https://claude.com/claude-code)
@graphite-app graphite-app bot force-pushed the eliminate-filename-with-hash-test branch from ee9c4f5 to a3c7162 Compare March 9, 2026 10:11
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 streamlines hashInFilename coverage in the rolldown integration tests by removing a single snapshot-based test that bundled the entire fixture corpus (slow and noisy) and replacing it with a small set of focused hash-related fixtures that snapshot only the relevant outputs.

Changes:

  • Removed the filename_with_hash integration test and its large snapshot.
  • Added 3 new targeted hashInFilename fixtures (basic, code splitting, dynamic import) plus updated the existing content-placeholder fixture to use hashed filenames.
  • Dropped now-unused dev-dependencies (glob, dunce) from crates/rolldown and updated Cargo.lock.

Reviewed changes

Copilot reviewed 16 out of 18 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
crates/rolldown/tests/integration_rolldown.rs Removes the heavy filename_with_hash test; leaves fixture-driven test discovery in place.
crates/rolldown/tests/snapshots/integration_rolldown__filename_with_hash.snap Deletes the large, high-churn snapshot generated by the removed test.
crates/rolldown/tests/rolldown/hash/basic/* Adds a minimal fixture ensuring entry filename hashing is applied and snapshotted.
crates/rolldown/tests/rolldown/hash/code_splitting/* Adds a fixture verifying hashed filenames under multiple inputs + shared chunk generation.
crates/rolldown/tests/rolldown/hash/dynamic_import/* Adds a fixture verifying hashed filenames for dynamic import chunking.
crates/rolldown/tests/rolldown/hash/content_include_placeholder/* Updates existing fixture to enable hashInFilename and updates its snapshot accordingly.
crates/rolldown/Cargo.toml Removes glob/dunce dev-deps that were only used by the deleted test.
Cargo.lock Lockfile update reflecting removed dependencies.

@@ -0,0 +1,4 @@
{
"hashInFilename": true,
"expectExecuted": false
Copy link

Copilot AI Mar 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These fixtures don’t execute output (expectExecuted: false) and don’t have a _test.mjs, so keeping the default writeToDisk: true does unnecessary filesystem I/O. Consider setting writeToDisk: false here to speed up the test further and reduce disk churn; syntax validation will still run for generated chunks.

Suggested change
"expectExecuted": false
"expectExecuted": false,
"writeToDisk": false

Copilot uses AI. Check for mistakes.
Comment on lines +1 to +10
{
"hashInFilename": true,
"expectExecuted": false,
"config": {
"input": [
{ "name": "a", "import": "./a.js" },
{ "name": "b", "import": "./b.js" }
]
}
}
Copy link

Copilot AI Mar 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These fixtures don’t execute output (expectExecuted: false) and don’t have a _test.mjs, so keeping the default writeToDisk: true does unnecessary filesystem I/O. Consider setting writeToDisk: false here to speed up the test further and reduce disk churn; syntax validation will still run for generated chunks.

Copilot uses AI. Check for mistakes.
{}
{
"hashInFilename": true,
"expectExecuted": false
Copy link

Copilot AI Mar 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fixture doesn’t execute output (expectExecuted: false) and doesn’t have a _test.mjs, so keeping the default writeToDisk: true does unnecessary filesystem I/O. Consider setting writeToDisk: false here to speed up the test further and reduce disk churn; syntax validation will still run for generated chunks.

Suggested change
"expectExecuted": false
"expectExecuted": false,
"writeToDisk": false

Copilot uses AI. Check for mistakes.
@@ -0,0 +1,4 @@
{
"hashInFilename": true,
"expectExecuted": false
Copy link

Copilot AI Mar 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These fixtures don’t execute output (expectExecuted: false) and don’t have a _test.mjs, so keeping the default writeToDisk: true does unnecessary filesystem I/O. Consider setting writeToDisk: false here to speed up the test further and reduce disk churn; syntax validation will still run for generated chunks.

Suggested change
"expectExecuted": false
"expectExecuted": false,
"writeToDisk": false

Copilot uses AI. Check for mistakes.
@graphite-app graphite-app bot merged commit a3c7162 into main Mar 9, 2026
35 checks passed
@graphite-app graphite-app bot deleted the eliminate-filename-with-hash-test branch March 9, 2026 10:20
This was referenced Mar 11, 2026
shulaoda added a commit that referenced this pull request Mar 11, 2026
## [1.0.0-rc.9] - 2026-03-11

### 💥 BREAKING CHANGES

- rename exported BindingMagicString to RolldownMagicString (#8626) by @IWANABETHATGUY

### 🚀 Features

- rolldown: add isRolldownMagicString property for reliable native detection (#8614) by @IWANABETHATGUY
- cli: align object type with rollup (#8598) by @h-a-n-a

### 🐛 Bug Fixes

- rust: circular inter-chunk imports when external dynamic imports exist (#8596) by @Dunqing
- update minify default docs from `false` to `'dce-only'` (#8620) by @shulaoda

### 💼 Other

- fix early exit in script build-node (#8617) by @h-a-n-a

### 🚜 Refactor

- binding: remove outdated TODO comment in MagicString to_string() (#8613) by @IWANABETHATGUY

### 📚 Documentation

- add viteplus alpha announcement banner (#8615) by @mdong1909
- update VitePress theme to 4.8.2 for narrow-screen layout regression (#8612) by @Copilot

### ⚡ Performance

- merge 4 integration test binaries into 1 (#8610) by @Boshen

### 🧪 Testing

- replace heavy filename_with_hash test with targeted hash fixtures (#8597) by @Boshen

### ⚙️ Miscellaneous Tasks

- ci: remove redundant `--no-run` build step from cargo-test (#8623) by @Boshen
- rust: use `cargo-shear` to toggle Cargo.toml [lib] test = bool (#8622) by @Boshen
- deps: update test262 submodule for tests (#8611) by @sapphi-red
- skip macOS CI jobs on pull requests (#8608) by @Copilot
- add rust cache to repo validation job (#8607) by @Boshen
- skip running empty bin test targets (#8605) by @Boshen
- skip building examples in cargo-test to reduce build time (#8603) by @Boshen
- switch plain workflow checkouts to taiki-e action (#8601) by @Boshen
- skip Windows CI jobs on PRs (#8600) by @Boshen
- remove unused asset module (#8594) by @shulaoda

### ◀️ Revert

- "docs: add viteplus alpha announcement banner (#8615)" (#8616) by @shulaoda

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

3 participants