From 6b1f75d26f627b5c4c58c9c9f4bf8bd7989135e3 Mon Sep 17 00:00:00 2001 From: Gibson Fahnestock Date: Wed, 22 Feb 2017 22:05:19 +0000 Subject: [PATCH] test: update test-npm to use test-npm-package.js Deletes the old test-npm.sh script. PR-URL: https://github.com/nodejs/node/pull/11540 Refs: https://github.com/nodejs/node/pull/7867 Reviewed-By: James M Snell Reviewed-By: Refael Ackermann --- Makefile | 2 +- tools/test-npm.sh | 43 ------------------------------------------- vcbuild.bat | 8 ++++++++ 3 files changed, 9 insertions(+), 44 deletions(-) delete mode 100755 tools/test-npm.sh diff --git a/Makefile b/Makefile index 4b40837b81f2e9..98a4c1b53ce2e8 100644 --- a/Makefile +++ b/Makefile @@ -432,7 +432,7 @@ test-known-issues: all $(PYTHON) tools/test.py known_issues test-npm: $(NODE_EXE) - NODE=$(NODE) tools/test-npm.sh + $(NODE) tools/test-npm-package --install --logfile=test-npm.tap deps/npm test-node test-npm-publish: $(NODE_EXE) npm_package_config_publishtest=true $(NODE) deps/npm/test/run.js diff --git a/tools/test-npm.sh b/tools/test-npm.sh deleted file mode 100755 index 421bdc207b96e2..00000000000000 --- a/tools/test-npm.sh +++ /dev/null @@ -1,43 +0,0 @@ -#!/bin/bash - -set -e - -# always change the working directory to the project's root directory -cd $(dirname $0)/.. - -# pass a $NODE environment variable from something like Makefile -# it should point to either ./node or ./node.exe, depending on the platform -if [ -z $NODE ]; then - echo "No node executable provided. Bailing." >&2 - exit 0 -fi - -rm -rf test-npm - -# make a copy of deps/npm to run the tests on -cp -r deps/npm test-npm - -cd test-npm - -# do a rm first just in case deps/npm contained these -rm -rf npm-cache npm-tmp npm-prefix -mkdir npm-cache npm-tmp npm-prefix - -# set some npm env variables to point to our new temporary folders -export npm_config_cache="$(pwd)/npm-cache" -export npm_config_prefix="$(pwd)/npm-prefix" -export npm_config_tmp="$(pwd)/npm-tmp" - -# ensure npm always uses the local node -export PATH="$(../$NODE -p 'require("path").resolve("..")'):$PATH" -unset NODE - -# make sure the binaries from the non-dev-deps are available -node bin/npm-cli.js rebuild -# install npm devDependencies and run npm's tests -node bin/npm-cli.js install --ignore-scripts --no-save -# run the tests -node bin/npm-cli.js run-script test-node - -# clean up everything one single shot -cd .. && rm -rf test-npm diff --git a/vcbuild.bat b/vcbuild.bat index 20555dec799b60..dde7faf1a27f45 100644 --- a/vcbuild.bat +++ b/vcbuild.bat @@ -89,6 +89,7 @@ if /i "%1"=="test-async-hooks" set test_args=%test_args% async-hooks&goto arg-o if /i "%1"=="test-all" set test_args=%test_args% gc internet pummel %common_test_suites%&set build_testgc_addon=1&set lint_cpp=1&set lint_js=1&goto arg-ok if /i "%1"=="test-node-inspect" set test_node_inspect=1&goto arg-ok if /i "%1"=="test-check-deopts" set test_check_deopts=1&goto arg-ok +if /i "%1"=="test-npm" set test_npm=1&goto arg-ok if /i "%1"=="test-v8" set test_v8=1&set custom_v8_test=1&goto arg-ok if /i "%1"=="test-v8-intl" set test_v8_intl=1&set custom_v8_test=1&goto arg-ok if /i "%1"=="test-v8-benchmarks" set test_v8_benchmarks=1&set custom_v8_test=1&goto arg-ok @@ -454,6 +455,13 @@ set USE_EMBEDDED_NODE_INSPECT=1 goto node-tests :node-tests +if not defined test_npm goto no-test-npm +set npm_test_cmd="%node_exe%" tools\test-npm-package.js --install --logfile=test-npm.tap deps\npm test-node +echo %npm_test_cmd% +%npm_test_cmd% +if errorlevel 1 goto exit +:no-test-npm + if "%test_args%"=="" goto test-v8 if "%config%"=="Debug" set test_args=--mode=debug %test_args% if "%config%"=="Release" set test_args=--mode=release %test_args%