Skip to content

perf: merge 4 integration test binaries into 1#8610

Merged
Boshen merged 7 commits intomainfrom
merge-integration-test-binaries
Mar 10, 2026
Merged

perf: merge 4 integration test binaries into 1#8610
Boshen merged 7 commits intomainfrom
merge-integration-test-binaries

Conversation

@Boshen
Copy link
Member

@Boshen Boshen commented Mar 9, 2026

Summary

  • Consolidates integration_esbuild, integration_rolldown, integration_rollup, and integration_test262 into a single integration test binary via tests/integration/main.rs
  • Eliminates 3 redundant ~80MB link steps on every incremental build (~240MB saved)
  • All 1704 tests continue to pass and can still be filtered (e.g. cargo test --test integration -- esbuild)

Details

The tests/rolldown/ directory stays in place (it contains both Rust modules and fixture data with intentionally broken syntax). The integration binary references it via #[path = "../rolldown/mod.rs"] mod rolldown_tests; to avoid both moving thousands of fixture files and shadowing the external rolldown crate name.

A dunce::canonicalize call was added to IntegrationTestBuilder::new() to resolve .. path segments that file!() produces when modules are loaded via #[path] attributes — this fixes HMR watch file path matching.

Measurements

Local incremental build (touch lib.rs, rebuild tests)

Metric Old (4 binaries) New (1 binary) Savings
Wall time 4.47s 3.73s -17%
CPU time 12.42s 6.48s -48%
Binaries linked 4 (78+79+76+64 = 297MB) 1 (82MB) -215MB disk

CI (ubuntu-latest)

Step Old (main, 4 binaries) New (PR, 1 binary) Savings
Build 51s 47s -4s
Run Test 86s 87s ~same
Total 137s 134s -3s

CI savings are modest since the build step is cached. The main win is local incremental builds — 48% less CPU work and 215MB less disk per build cycle.

🤖 Generated with Claude Code

Consolidates integration_esbuild, integration_rolldown, integration_rollup,
and integration_test262 into a single `integration` test binary. This
eliminates 3 redundant ~80MB link steps on every incremental build.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings March 9, 2026 16:33
@netlify
Copy link

netlify bot commented Mar 9, 2026

Deploy Preview for rolldown-rs canceled.

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

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

Consolidates multiple Rust integration test binaries for rolldown into a single integration test target to reduce redundant link steps and keep test filtering working.

Changes:

  • Introduces a unified integration test crate entrypoint under crates/rolldown/tests/integration/main.rs that pulls in esbuild/rollup/rolldown/test262 suites as modules.
  • Updates test262-related docs, in-code command hints, and an insta snapshot source: path to reflect the new test layout.
  • Moves/adjusts integration test module files under crates/rolldown/tests/integration/.

Reviewed changes

Copilot reviewed 6 out of 7 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
docs/development-guide/testing.md Updates the documented test262 command to use the unified integration test binary name.
crates/rolldown/tests/snapshots/test262__test262_module_code.snap Updates snapshot metadata to point at the new test262 source file location.
crates/rolldown/tests/integration/test262.rs Updates the example command comment to reference the unified integration test binary.
crates/rolldown/tests/integration/rollup.rs Adds rollup fixture-based tests as a module for the unified integration test crate.
crates/rolldown/tests/integration/rolldown_fixture.rs Adjusts module wiring now that tests are intended to be included from a shared entrypoint.
crates/rolldown/tests/integration/main.rs Adds the new unified integration test entrypoint that aggregates all suites.
crates/rolldown/tests/integration/esbuild.rs Removes per-module lint allowance in favor of the new shared entrypoint.

Boshen and others added 2 commits March 10, 2026 00:41
The insta snapshot name includes the binary name prefix, so it should be
integration__test262__. Also canonicalize test folder paths to resolve
`..` segments from #[path] attributes, fixing HMR watch file assertions.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings March 9, 2026 16:42
@Boshen Boshen review requested due to automatic review settings March 9, 2026 16:42
Renames the `mod rolldown` to `mod rolldown_tests` to avoid shadowing
the external `rolldown` crate name in the integration test binary.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings March 9, 2026 16:45
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

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

Comments suppressed due to low confidence (1)

crates/rolldown/tests/integration/test262.rs:563

  • This example command will run all tests in the consolidated integration binary. Consider adding a test-name filter (e.g. test262_module_code or test262) so the example actually only runs the test262 suite in addition to TEST262_FILTER.

@github-actions
Copy link
Contributor

github-actions bot commented Mar 9, 2026

Benchmarks Rust

group                                                        pr                                     target
-----                                                        --                                     ------
bundle/bundle@multi-duplicated-top-level-symbol              1.08     85.9±3.01ms        ? ?/sec    1.00     79.9±2.48ms        ? ?/sec
bundle/bundle@multi-duplicated-top-level-symbol-sourcemap    1.04     92.3±2.80ms        ? ?/sec    1.00     88.8±2.48ms        ? ?/sec
bundle/bundle@rome_ts                                        1.08    186.0±2.60ms        ? ?/sec    1.00    172.9±6.14ms        ? ?/sec
bundle/bundle@rome_ts-sourcemap                              1.08    204.9±3.13ms        ? ?/sec    1.00    190.3±5.84ms        ? ?/sec
bundle/bundle@threejs                                        1.06     84.4±3.18ms        ? ?/sec    1.00     79.4±4.52ms        ? ?/sec
bundle/bundle@threejs-sourcemap                              1.07     94.8±1.73ms        ? ?/sec    1.00     88.4±4.49ms        ? ?/sec
bundle/bundle@threejs10x                                     1.03    796.6±9.40ms        ? ?/sec    1.00   775.5±11.12ms        ? ?/sec
bundle/bundle@threejs10x-sourcemap                           1.01   900.6±10.81ms        ? ?/sec    1.00    889.7±8.31ms        ? ?/sec
scan/scan@rome_ts                                            1.00     79.0±1.66ms        ? ?/sec    1.01     79.9±1.68ms        ? ?/sec
scan/scan@threejs                                            1.02     28.4±1.69ms        ? ?/sec    1.00     27.8±0.86ms        ? ?/sec
scan/scan@threejs10x                                         1.00    270.7±3.56ms        ? ?/sec    1.00    272.0±2.83ms        ? ?/sec

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Boshen <boshenc@gmail.com>
Copilot AI review requested due to automatic review settings March 10, 2026 03:30
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

Copilot reviewed 7 out of 8 changed files in this pull request and generated 1 comment.

Comments suppressed due to low confidence (1)

crates/rolldown/tests/integration/test262.rs:563

  • The example command in this comment no longer targets just this test. cargo test --test integration -- --no-capture will run all integration suites (esbuild/rollup/rolldown/test262), which is misleading when explaining TEST262_FILTER. Update the example to include a test filter (e.g. ... --test integration test262_module_code ...) so it runs only this test function.

Insta looks for snapshots relative to the source file, so moving
test262.rs into tests/integration/ means the snapshot must be in
tests/integration/snapshots/.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@Boshen Boshen mentioned this pull request Mar 10, 2026
@Boshen Boshen merged commit d03e11a into main Mar 10, 2026
34 checks passed
@Boshen Boshen deleted the merge-integration-test-binaries branch March 10, 2026 04:27
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