Skip to content

test: verify node_modules canonicalization across layouts#1200

Merged
Boshen merged 1 commit into
mainfrom
node-modules-canonicalize-tests
Jun 4, 2026
Merged

test: verify node_modules canonicalization across layouts#1200
Boshen merged 1 commit into
mainfrom
node-modules-canonicalize-tests

Conversation

@Boshen

@Boshen Boshen commented Jun 4, 2026

Copy link
Copy Markdown
Member

Adds a node_modules canonicalization test suite + committed symlink fixtures that assert the resolver's canonicalization equals std::fs::canonicalize across the layout families:

  • canonicalize_matches_os_for_all_node_modules — walks every path in each installed fixtures/bench-pm/installs/<combo>/node_modules tree (npm/pnpm/yarn/bun × flat/isolated/hoisted/pnp); skipped when the bench fixtures aren't installed.
  • symlinked_package_anchor_walks_suffix_symlinks — a symlinked workspace anchor with a symlink in the suffix below it.
  • real_package_anchor_walks_internal_symlinks — a real node_modules/<pkg> anchor that ships an internal directory/file symlink (lib -> dist, a re-export file).
  • nested_monorepo_canonicalize_matches_os — a monorepo version conflict where a workspace package nests its own dependency version via an isolated-store symlink (root resolves dep@2, packages/ui nests dep@1).

These all pass on main — they pin canonicalization correctness independent of any resolver optimization, so they can land on their own (and guard #1189).

🤖 Generated with Claude Code

@codecov

codecov Bot commented Jun 4, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.75%. Comparing base (6ae46ed) to head (44566bd).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1200   +/-   ##
=======================================
  Coverage   93.75%   93.75%           
=======================================
  Files          22       22           
  Lines        4229     4229           
=======================================
  Hits         3965     3965           
  Misses        264      264           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@codspeed-hq

codspeed-hq Bot commented Jun 4, 2026

Copy link
Copy Markdown

Merging this PR will improve performance by 5.35%

⚠️ Different runtime environments detected

Some benchmarks with significant performance changes were compared across different runtime environments,
which may affect the accuracy of the results.

Open the report in CodSpeed to investigate

⚡ 3 improved benchmarks
✅ 18 untouched benchmarks
⏩ 5 skipped benchmarks1

Performance Changes

Benchmark BASE HEAD Efficiency
pm/pnpm-isolated 1.1 ms 1.1 ms +6.62%
resolver_memory[multi-thread] 412.6 µs 389.2 µs +6.01%
pm/yarn-isolated 1.1 ms 1.1 ms +3.44%

Tip

Curious why this is faster? Comment @codspeedbot explain why this is faster on this PR, or directly use the CodSpeed MCP with your agent.


Comparing node-modules-canonicalize-tests (44566bd) with main (6ae46ed)

Open in CodSpeed

Footnotes

  1. 5 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

Add canonicalization checks to `symlink.rs` (alongside the existing symlink
resolution tests) with committed symlink fixtures, asserting the resolver's
canonicalization equals `std::fs::canonicalize`:

- `canonicalize_matches_os_for_all_node_modules` — walks every path in each
  installed `fixtures/bench-pm/installs/<combo>/node_modules` tree; skipped when
  the bench fixtures are not installed.
- `symlinked_package_anchor_walks_suffix_symlinks` — a symlinked workspace anchor
  with a symlink in the suffix below it.
- `real_package_anchor_walks_internal_symlinks` — a real anchor that ships an
  internal directory/file symlink.
- `nested_monorepo_canonicalize_matches_os` — a monorepo version conflict where a
  workspace nests its own dependency version via an isolated-store symlink.

These pass on main; they pin canonicalization correctness independent of any
resolver optimization.
@Boshen Boshen force-pushed the node-modules-canonicalize-tests branch from dbfbbab to 44566bd Compare June 4, 2026 15:05
@Boshen Boshen merged commit 8252151 into main Jun 4, 2026
18 checks passed
@Boshen Boshen deleted the node-modules-canonicalize-tests branch June 4, 2026 17:22
@oxc-guard oxc-guard Bot mentioned this pull request Jun 4, 2026
Boshen pushed a commit that referenced this pull request Jun 17, 2026
## 🤖 New release

* `oxc_resolver`: 11.21.0 -> 11.21.1
* `oxc_resolver_napi`: 11.21.0 -> 11.21.1

<details><summary><i><b>Changelog</b></i></summary><p>

## `oxc_resolver`

<blockquote>

##
[11.21.1](v11.21.0...v11.21.1)
- 2026-06-17

### <!-- 1 -->🐛 Bug Fixes

- *(tsconfig)* walk up for non-TS and `allowJs`-off `.js` importers
([#1216](#1216)) (by
@shulaoda)
- *(tsconfig)* honor explicit non-TS extensions in `include`
([#1213](#1213)) (by
@shulaoda)

### <!-- 2 -->🚜 Refactor

- *(cache)* replace papaya with dashmap
([#1214](#1214)) (by
@Boshen)

### <!-- 6 -->🧪 Testing

- verify node_modules canonicalization across layouts
([#1200](#1200)) (by
@Boshen)

### Contributors

* @shulaoda
* @Boshen
</blockquote>



</p></details>

---
This PR was generated with
[release-plz](https://github.com/release-plz/release-plz/).

Co-authored-by: oxc-guard[bot] <276638029+oxc-guard[bot]@users.noreply.github.com>
@oxc-guard oxc-guard Bot mentioned this pull request Jun 17, 2026
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.

1 participant