Repository navigation
Conversation
The installer tests create fake node/npm stubs and set PATH to use them. But spreading ...process.env leaks NVM_DIR/FNM_DIR, causing ensure_nvm_loaded() to source the real nvm.sh which puts the real node/npm back on PATH — overriding the test stubs. Set NVM_DIR and FNM_DIR to empty strings in all test spawn envs so the installer's version manager detection is neutralized. Root cause: tests only failed on machines with nvm installed.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe test harness now explicitly sets Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
Comment Tip CodeRabbit can use TruffleHog to scan for secrets in your code with verification capabilities.Add a TruffleHog config file (e.g. trufflehog-config.yml, trufflehog.yml) to your project to customize detectors and scanning behavior. The tool runs only when a config file is present. |
There was a problem hiding this comment.
Pull request overview
Fixes flaky installer preflight tests on developer machines where nvm/fnm are installed by preventing version-manager detection from leaking into spawnSync subprocess environments (which could cause the real node/npm to override the test stubs).
Changes:
- Override
NVM_DIRandFNM_DIRto empty strings in each testspawnSyncenvironment to prevent loading/sourcing version-manager shims. - Keep
...process.envwhile ensuring the tests’ stubbedPATHremains authoritative.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Thanks for sharing a fix for the issue with nvm/fnm overriding fake stubs in installer tests, this should make our tests more reliable. |
|
Thanks for this — nvm/fnm interference with installer test stubs is a real flakiness source. The installer test setup has changed since March. Could you rebase against main and verify the fix still applies cleanly to the current test harness? |
|
This PR still has merge conflicts against main. If the branch isn't updated in the next 7 days we'll close it to keep the queue healthy — feel free to reopen once it's rebased, or open a new PR. Thanks for contributing to NemoClaw! |
|
Closing due to inactivity |
Summary
Installer preflight tests fail on machines with nvm or fnm installed. The test stubs for
nodeandnpmget silently overridden by the real binaries.Root Cause
All 6
spawnSynccalls ininstall-preflight.test.jsspread...process.env, which leaksNVM_DIR(andFNM_DIR) into the child process. The installer'sensure_nvm_loaded()then sources$NVM_DIR/nvm.sh, which prepends the real Node.js bin directory toPATH— overriding the fakenode/npmstubs the test set up.Fix
Set
NVM_DIR: ""andFNM_DIR: ""in each spawn's env to neutralize version manager detection without removing other needed env vars.Changes
test/install-preflight.test.js— 6 lines changed (one perspawnSynccall)Test plan
Summary by CodeRabbit