Problem
make npm-package-test can pass even when npm packaging commands fail.
Observed locally:
npm pack --dry-run failed with npm cache EPERM
make npm-package-test still exited 0
Cause: the Makefile recipe runs multiple commands in one shell block without set -e, so a failed middle command can be masked by the final successful rm -rf.
Same risk exists in the install smoke block under make test.
Impact: CI can pass while packaging/install smoke checks are broken.
Proposed solution
- Add
set -e; at the start of the multi-command recipe blocks.
- Use a temp npm cache for
npm pack --dry-run, matching npm install behavior.
- Ensure temp dirs are still cleaned up on success.
Alternatives considered
- Split each smoke command into separate Makefile recipe lines.
- Wrap smoke logic in a dedicated shell test script with
set -euo pipefail.
- Use
trap cleanup for stronger temp-dir cleanup if moving logic into a script.
Scope
Problem
make npm-package-testcan pass even when npm packaging commands fail.Observed locally:
npm pack --dry-runfailed with npm cacheEPERMmake npm-package-teststill exited0Cause: the Makefile recipe runs multiple commands in one shell block without
set -e, so a failed middle command can be masked by the final successfulrm -rf.Same risk exists in the install smoke block under
make test.Impact: CI can pass while packaging/install smoke checks are broken.
Proposed solution
set -e;at the start of the multi-command recipe blocks.npm pack --dry-run, matchingnpm installbehavior.Alternatives considered
set -euo pipefail.trapcleanup for stronger temp-dir cleanup if moving logic into a script.Scope