Skip to content

test(server): resolve the temp dir before matching the symlinked entrypoint - #9400

Open
ylcn91 wants to merge 1 commit into
pingdotgg:mainfrom
ylcn91:fix/entrypoint-test-macos-tmpdir
Open

ylcn91 wants to merge 1 commit into
pingdotgg:mainfrom
ylcn91:fix/entrypoint-test-macos-tmpdir

Conversation

@ylcn91

@ylcn91 ylcn91 commented Sep 3, 2026 •

Copy link
Copy Markdown

What Changed

apps/server/src/entrypoint.test.ts, "matches through a symlinked entrypoint": the expected module URL is now built from realpathSync(real) instead of the raw temp path. One line plus a comment.

Why

Fixes #9389.

isEntrypoint compares the module URL against the realpath of the entry, which is what makes npm/npx-style symlinked entrypoints match. The fixture built its expected URL from the un-resolved temp path. On macOS the temp dir lives under /var, itself a symlink to /private/var, so the two strings never matched and the test failed on every run. Linux CI is unaffected, which is why this only shows up locally on macOS.

The product code is correct. Canonicalizing the fixture path keeps the test focused on the symlink it is meant to exercise.

Before, on macOS:

× matches through a symlinked entrypoint, as npm and npx install it
AssertionError: expected false to be true

After:

Test Files  1 passed (1)
     Tests  5 passed (5)

Server typecheck and lint are clean.

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for any UI changes (no UI changes)
  • I included a video for animation/interaction changes (not applicable)

Model and harness: Claude Fable 5.1 in Claude Code.


Note

Low Risk
Test-only change; entrypoint detection logic is untouched.

Overview
Fixes a macOS-only failure in entrypoint.test.ts for the symlinked npm/npx entrypoint case (#9389).

The test now builds the expected moduleUrl from NodeFS.realpathSync(real) instead of the raw temp path, matching how isEntrypoint compares against the realpath of entryPath. On macOS, temp dirs under /var (symlinked to /private/var) made the old expected string never match even though production behavior is correct.

Adds a short comment explaining Node URL resolution and the /var symlink. No production code changes.

Reviewed by Cursor Bugbot for commit f629824. Configure here.

Note

Resolve temp dir real path in isEntrypoint symlinked-entrypoint test

Updates the test fixture's module URL in entrypoint.test.ts to use the filesystem-resolved real path of the target file. Node resolves module URLs to real paths, and macOS temp directories can be symlinked, which caused the previous assertion to fail.

Macroscope summarized f629824.

Summary by CodeRabbit

  • Bug Fixes
    • Fixed symlinked entrypoint testing to correctly resolve module URLs to the underlying real file path, including environments where temporary directories use symlinks.

@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:XS 0-9 changed lines (additions + deletions). labels Sep 3, 2026
@macroscopeapp

macroscopeapp Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at f629824

Macroscope's review found this PR approvable — This small change only canonicalizes a temporary test path so the symlinked-entrypoint test works on macOS. Production code, product defaults, and static-analysis configuration are unchanged.

Notes:

  • No code objects were reviewed. Approvability was decided on eligibility alone.

You can add or adjust custom eligibility rules. Learn more.

@Mnigos Mnigos left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can confirm on macOS: the entrypoint symlink test fails on main exactly as #9389 describes and passes with this change. Same /var to /private/var class I just ran into on the server side, resolving before asserting is the right call.

@shivamhwp

Copy link
Copy Markdown
Collaborator

Note: GPT-6 on behalf of shivam (@shivamhwp).

This branch conflicts with the newer symlink-support guard in main. Please rebase the realpath correction while keeping it.skipIf(!symlinksSupported), so Windows installations without symlink privileges keep skipping the fixture.

…ypoint

The symlinked-entrypoint case builds its expected module URL from the raw
temp path, but isEntrypoint compares against the realpath of the entry.
On macOS the temp dir lives under /var, which is itself a symlink to
/private/var, so the two strings never match and the test fails on every
run. Linux CI is unaffected.

Canonicalize the fixture path with realpathSync so the test only
exercises the npm/npx symlink it is meant to cover.

Fixes pingdotgg#9389
@ylcn91
ylcn91 force-pushed the fix/entrypoint-test-macos-tmpdir branch from f629824 to c962d18 Compare September 11, 2026 04:54
@ylcn91

ylcn91 commented Sep 11, 2026

Copy link
Copy Markdown
Author

Rebased onto main. The it.skipIf(!symlinksSupported) guard stays as is; the only change is still the realpathSync on the module URL.

@coderabbitai

coderabbitai Bot commented Sep 11, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: f13b62d4-0631-428d-935b-a5a65060ecd9

📥 Commits

Reviewing files that changed from the base of the PR and between 57aee3e and c962d18.

📒 Files selected for processing (1)
  • apps/server/src/entrypoint.test.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.


📝 Walkthrough

Walkthrough

The symlinked-entrypoint test now resolves the real module path before creating moduleUrl. This prevents macOS temporary-directory symlink resolution from causing a false test failure.

Changes

Entrypoint symlink test

Layer / File(s) Summary
Canonicalize test module path
apps/server/src/entrypoint.test.ts
The test passes NodeFS.realpathSync(real) to pathToFileURL and documents Node's module URL resolution behavior.

Priority: ⬇️ Low

Estimated code review effort: 1 (Trivial) | ~3 minutes

Change: Other · Severity of issue fixed: Low

Suggested reviewers: mnigos

Merge Risk: ⚪ Minimal · up to c962d

The test-only change resolves the macOS path mismatch while preserving Windows skipping behavior for unsupported symlink environments.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the test change and the reason for resolving the temporary directory before matching the symlinked entrypoint.
Description check ✅ Passed The description includes the changed file, the macOS failure cause, the rationale, test results, scope, and checklist status. It is focused and matches the pull request objectives.
Linked Issues check ✅ Passed Issue #9389 requires the symlinked-entrypoint test to canonicalize the fixture path before building moduleUrl. The test now uses NodeFS.realpathSync(real) with NodeURL.pathToFileURL, so the expe…
Out of Scope Changes check ✅ Passed The pull request changes only apps/server/src/entrypoint.test.ts. The added comment and the realpathSync correction directly support issue #9389. No unrelated production or public API changes are …
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1…
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS 0-9 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test(server): entrypoint symlink case asserts unrealpath'd module URL — fails on macOS (/var → /private/var)

3 participants