Repository navigation
test(server): entrypoint symlink test passes on macOS - #16438
yaacovcorcos wants to merge 1 commit into
Conversation
`matches through a symlinked entrypoint, as npm and npx install it` fails on macOS. Its temp directory sits under `/var`, a link into `/private/var`, so the fixture's module URL is a path Node never produces: Node resolves the entry module's real path. Real launches already work; under Node 22.17 on macOS the CLI was recognized when run through `/tmp`, `/private/tmp`, an npm-style bin link, `PATH`, a symlinked package directory, a relative path, and `--preserve-symlinks-main`. Resolve the test's temp directory to its real path. Only the test changes. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — This is a five-line maintenance change confined to ignored test content, with no production runtime, product-default, or static-analysis configuration impact. Its scope and risk are sufficiently limited for automated approval. Notes:
You can add or adjust custom eligibility rules. Learn more. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (1)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review. 📝 WalkthroughWalkthroughThe ChangesTemporary directory helper
Priority: ⬇️ Low Estimated code review effort: 1 (Trivial) | ~3 minutes Change: Other Merge Risk: ⚪ Minimal · up to The test fixture now uses the resolved temporary-directory path, with no production behavior changed. No actionable merge risk remains beyond normal checks. 🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Problem
matches through a symlinked entrypoint, as npm and npx install itinapps/server/src/entrypoint.test.tsfails on macOS. Its temp directory sits under/var, which isa link into
/private/var. The test builds the module URL from that unresolved path, but Nodealways resolves the entry module's real path, so the fixture describes a launch that cannot happen.
On Linux the temp directory is real and the test passes.
Fix
Resolve the test's temp directory with
realpathSyncinmakeTempDir.entrypoint.tsdoes notchange.
Why it qualifies
Maintenance fix with no user impact: one test helper, so the server tests pass on macOS.
How it was established and checked
Before (
cd apps/server && vp test run src/entrypoint.test.ts, macOS):After:
Tests 5 passed (5).To confirm the production check is already correct, I ran
isEntrypointfromentrypoint.tsas areal entry module under Node 22.17 on macOS (a version without
import.meta.main, so the fallbackruns). The CLI was recognized when launched through
/tmp, through/private/tmp, through annpm-style bin symlink, from
PATH, through a symlinked package directory, with a relative path, andwith
--preserve-symlinks-main.Also run:
vp fmt --check apps/server/src(clean),vp lint --report-unused-disable-directives apps/server/src(no findings in the changed file), andvp run typecheckinapps/server(no new errors; the only errors are insrc/process/externalLauncher.test.ts, which this change does not touch).Not checked
Windows and Linux; the change only resolves a path that is already real there.
Found in a downstream fork (Scient), then fixed on current main. Investigated and verified with
Claude Opus 5.5 in Claude Code.
🤖 Generated with Claude Code