From 00af6341f760fdfcee86b4c9e7c41f16b79d0ba9 Mon Sep 17 00:00:00 2001 From: Alex Aubuchon Date: Tue, 3 Nov 2020 19:05:34 -0500 Subject: [PATCH] [Tests] Run fast test suite in clean environment --- package.json | 2 +- .../fast/Running \"nvm use iojs\" uses latest io.js version" | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 67efcde..14ec86f 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ }, "scripts": { "test": "shell=$(basename -- $(ps -o comm= $(ps -o ppid= -p $PPID)) | sed 's/^-//'); make test-$shell", - "test/fast": "shell=$(basename -- $(ps -o comm= $(ps -o ppid= -p $PPID)) | sed 's/^-//'); make TEST_SUITE=fast test-$shell", + "test/fast": "shell=$(basename -- $(ps -o comm= $(ps -o ppid= -p $PPID)) | sed 's/^-//'); env -i TERM=\"$TERM\" bash -lc \"make TEST_SUITE=fast test-$shell\"", "test/slow": "shell=$(basename -- $(ps -o comm= $(ps -o ppid= -p $PPID)) | sed 's/^-//'); make TEST_SUITE=slow test-$shell", "test/install_script": "shell=$(basename -- $(ps -o comm= $(ps -o ppid= -p $PPID)) | sed 's/^-//'); make TEST_SUITE=install_script test-$shell", "test/installation": "npm run --silent test/installation/node && npm run --silent test/installation/iojs", diff --git "a/test/fast/Running \"nvm use iojs\" uses latest io.js version" "b/test/fast/Running \"nvm use iojs\" uses latest io.js version" index fafc9c7..be383ce 100755 --- "a/test/fast/Running \"nvm use iojs\" uses latest io.js version" +++ "b/test/fast/Running \"nvm use iojs\" uses latest io.js version" @@ -27,7 +27,9 @@ EXPECTED_OUTPUT="$(nvm_add_iojs_prefix ${VERSION})" nvm use --delete-prefix iojs || die '`nvm use iojs` failed' -CURRENT="$(nvm current)" +# Remove node_modules/.bin from the path so that the system version `which` is +# used in nvm_ls_current +PATH=$(echo "$PATH" | tr ":" "\n" | grep -v "node_modules/.bin" | tr "\n" ":") CURRENT="$(nvm current)" echo "current: ${CURRENT}" [ "${CURRENT}" = "${IOJS_VERSION}" ] || die "expected >${IOJS_VERSION}<; got >${CURRENT}<"