Skip to content
This repository was archived by the owner on Apr 22, 2023. It is now read-only.

Commit 03b4f44

Browse files
author
Julien Gilli
committed
test: make test-npm uses custom node, not global
When running make test-npm, make would use the node binary available in the PATH, which would most of the time not be the same binary as the one built from the source tree from where the make test-npm command in run. This can be confusing, as it can lead users to think that they tested npm with the version of node that was built from the current checkout of the source tree when it would actually run the tests with a completely different version. This change modifies the PATH environment variable for all commands that need to run the node binary to run npm's tests by adding the root of the local checkout as the first entry, so that the custom built node is always used. Reviewed-By: Colin Ihrig <cjihrig@gmail.com> PR-URL: #9107
1 parent cb55a05 commit 03b4f44

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -154,12 +154,12 @@ test-npm: node
154154
cd deps/npm ; npm_config_cache="$(shell pwd)/npm-cache" \
155155
npm_config_prefix="$(shell pwd)/npm-prefix" \
156156
npm_config_tmp="$(shell pwd)/npm-tmp" \
157-
../../node cli.js install
157+
PATH="../../:${PATH}" node cli.js install
158158
cd deps/npm ; npm_config_cache="$(shell pwd)/npm-cache" \
159159
npm_config_prefix="$(shell pwd)/npm-prefix" \
160160
npm_config_tmp="$(shell pwd)/npm-tmp" \
161-
../../node cli.js run-script test-all && \
162-
../../node cli.js prune --prod && \
161+
PATH="../../:${PATH}" node cli.js run-script test-all && \
162+
PATH="../../:${PATH}" node cli.js prune --prod && \
163163
cd ../.. && \
164164
rm -rf npm-cache npm-tmp npm-prefix
165165

0 commit comments

Comments
 (0)