Skip to content
This repository was archived by the owner on Apr 22, 2023. It is now read-only.
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
  • Loading branch information
Julien Gilli committed Jan 28, 2015
commit b393e8c9b451ab7ed39afd4c803e6c24425548b8
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -154,12 +154,12 @@ test-npm: node
cd deps/npm ; npm_config_cache="$(shell pwd)/npm-cache" \
npm_config_prefix="$(shell pwd)/npm-prefix" \
npm_config_tmp="$(shell pwd)/npm-tmp" \
../../node cli.js install
PATH="../../:${PATH}" node cli.js install
cd deps/npm ; npm_config_cache="$(shell pwd)/npm-cache" \
npm_config_prefix="$(shell pwd)/npm-prefix" \
npm_config_tmp="$(shell pwd)/npm-tmp" \
../../node cli.js run-script test-all && \
../../node cli.js prune --prod && \
PATH="../../:${PATH}" node cli.js run-script test-all && \
PATH="../../:${PATH}" node cli.js prune --prod && \
cd ../.. && \
rm -rf npm-cache npm-tmp npm-prefix

Expand Down