test: fix environment sensitivity in resolveNpmCommandInvocation test#83405
Conversation
|
Codex review: needs maintainer review before merge. Workflow note: Future ClawSweeper reviews update this same comment in place. How this review workflow works
Summary Reproducibility: yes. by source inspection: current main omits PR rating Rank-up moves:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. Real behavior proof Next step before merge Security Review detailsBest possible solution: Land the one-line test isolation so the fallback assertion is deterministic across npm- and pnpm-run test environments. Do we have a high-confidence way to reproduce the issue? Yes, by source inspection: current main omits Is this the best way to solve the issue? Yes. The PR uses the helper's existing Label changes:
Label justifications:
What I checked:
Likely related people:
Codex review notes: model gpt-5.5, reasoning high; reviewed against 4399eee6e0e4. |
There was a problem hiding this comment.
Pull request overview
This PR makes a release-check unit test deterministic by preventing resolveNpmCommandInvocation from falling back to the caller’s process.env.npm_execpath during the Windows platform fallback assertion.
Changes:
- Passes
npmExecPath: ""explicitly in the affected test case. - Keeps production implementation unchanged.
e82a69e to
b941562
Compare
|
ClawSweeper PR egg ✨ Hatched: 🌱 uncommon Clockwork Lint Imp Hatch commandComment Hatchability rules:
Rarity: 🌱 uncommon. What is this egg doing here?
|
b941562 to
b2c2e9a
Compare
|
Merged via squash.
Thanks @medns! |
…openclaw#83405) Merged via squash. Prepared head SHA: b2c2e9a Co-authored-by: medns <[email protected]> Co-authored-by: odysseus0 <[email protected]> Reviewed-by: @odysseus0
…openclaw#83405) Merged via squash. Prepared head SHA: b2c2e9a Co-authored-by: medns <[email protected]> Co-authored-by: odysseus0 <[email protected]> Reviewed-by: @odysseus0
…openclaw#83405) Merged via squash. Prepared head SHA: b2c2e9a Co-authored-by: medns <[email protected]> Co-authored-by: odysseus0 <[email protected]> Reviewed-by: @odysseus0
…openclaw#83405) Merged via squash. Prepared head SHA: b2c2e9a Co-authored-by: medns <[email protected]> Co-authored-by: odysseus0 <[email protected]> Reviewed-by: @odysseus0
…openclaw#83405) Merged via squash. Prepared head SHA: b2c2e9a Co-authored-by: medns <[email protected]> Co-authored-by: odysseus0 <[email protected]> Reviewed-by: @odysseus0
…openclaw#83405) Merged via squash. Prepared head SHA: b2c2e9a Co-authored-by: medns <[email protected]> Co-authored-by: odysseus0 <[email protected]> Reviewed-by: @odysseus0
…openclaw#83405) Merged via squash. Prepared head SHA: b2c2e9a Co-authored-by: medns <[email protected]> Co-authored-by: odysseus0 <[email protected]> Reviewed-by: @odysseus0
…openclaw#83405) Merged via squash. Prepared head SHA: b2c2e9a Co-authored-by: medns <[email protected]> Co-authored-by: odysseus0 <[email protected]> Reviewed-by: @odysseus0
…openclaw#83405) Merged via squash. Prepared head SHA: b2c2e9a Co-authored-by: medns <[email protected]> Co-authored-by: odysseus0 <[email protected]> Reviewed-by: @odysseus0
…openclaw#83405) Merged via squash. Prepared head SHA: b2c2e9a Co-authored-by: medns <[email protected]> Co-authored-by: odysseus0 <[email protected]> Reviewed-by: @odysseus0
…openclaw#83405) Merged via squash. Prepared head SHA: b2c2e9a Co-authored-by: medns <[email protected]> Co-authored-by: odysseus0 <[email protected]> Reviewed-by: @odysseus0
Summary
resolveNpmCommandInvocationtest "uses the platform npm command when npm_execpath is missing" was failing locally because it implicitly read thenpm_execpathenvironment variable injected by the localnpm testrunner.npm test, making the test suite environment-sensitive.npmExecPath: ""to the function call in the test to bypass the environment variable fallback.resolveNpmCommandInvocationis unchanged.Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
Real behavior proof (required for external PRs)
test/openclaw-npm-release-check.test.tsdue to environment sensitivity.npm test test/openclaw-npm-release-check.test.tsTerminal output:
npm_execpathenvironment variable.Root Cause (if applicable)
npmExecPathargument, causing the function to fall back toprocess.env.npm_execpath, which is populated by thenpm testrunner.npm_execpathwas not set, or run via a different runner.Regression Test Plan (if applicable)
test/openclaw-npm-release-check.test.tsnpmExecPathis explicitly empty.User-visible / Behavior Changes
None.
Diagram (if applicable)
N/A
Security Impact (required)
NoNoNoNoNoRepro + Verification
Environment
Steps
npm test test/openclaw-npm-release-check.test.tslocally.Expected
Actual
Evidence
Human Verification (required)
npm test.Review Conversations
Compatibility / Migration
YesNoNoRisks and Mitigations
None.