From 447940acb3b99dff11e0e3413236ba1ca18ad141 Mon Sep 17 00:00:00 2001 From: Jordan Harband Date: Thu, 22 Dec 2022 11:26:27 -0800 Subject: [PATCH] [Tests] move tests that fail on focal to a separate suite that runs on xenial --- .travis.yml | 16 ++++++- test/installation_node/install from source | 2 +- .../install from source with thread parameter | 2 +- ...ll from source without V8 snapshot for ARM | 2 +- test/installation_node/install hook | 2 +- test/xenial/install from source | 29 ++++++++++++ .../install from source implicitly | 0 .../install from source with thread parameter | 33 ++++++++++++++ ...ll from source without V8 snapshot for ARM | 25 +++++++++++ test/xenial/install hook | 45 +++++++++++++++++++ ...ll version specified in .nvmrc from source | 0 .../node 0.6.21 should install 0.6.21-pre | 0 12 files changed, 150 insertions(+), 6 deletions(-) create mode 100755 test/xenial/install from source rename test/{installation_node => xenial}/install from source implicitly (100%) create mode 100755 test/xenial/install from source with thread parameter create mode 100755 test/xenial/install from source without V8 snapshot for ARM create mode 100755 test/xenial/install hook rename test/{installation_node => xenial}/install version specified in .nvmrc from source (100%) rename test/{slow => xenial}/node 0.6.21 should install 0.6.21-pre (100%) diff --git a/.travis.yml b/.travis.yml index c2138af..5b1e188 100644 --- a/.travis.yml +++ b/.travis.yml @@ -22,14 +22,26 @@ before_install: - bash --version | head - zsh --version - dpkg -s dash | grep ^Version | awk '{print $2}' - - pyenv local 3.9 + - pyenv local 3.9 || echo 'pyenv failed' install: - if [ -z "${SHELLCHECK-}" ]; then nvm install 16 && nvm unalias default && npm install && npm prune && npm ls urchin doctoc eclint dockerfile_lint; fi - '[ -z "$WITHOUT_CURL" ] || sudo apt-get remove curl -y' script: - - if [ -n "${SHELL-}" ] && [ -n "${TEST_SUITE}" ]; then if [ "${TEST_SUITE}" = 'installation_iojs' ]; then travis_retry make TEST_SUITE=$TEST_SUITE URCHIN="$(npm bin)/urchin" test-$SHELL ; else make TEST_SUITE=$TEST_SUITE URCHIN="$(npm bin)/urchin" test-$SHELL; fi; fi + - if [ -n "${SHELL-}" ] && [ -n "${TEST_SUITE}" ]; then if [ "${TEST_SUITE}" = 'installation_iojs' ] || [ "${TEST_SUITE}" = 'xenial' ]; then travis_retry make TEST_SUITE=$TEST_SUITE URCHIN="$(npm bin)/urchin" test-$SHELL ; else make TEST_SUITE=$TEST_SUITE URCHIN="$(npm bin)/urchin" test-$SHELL; fi; fi before_cache: - if [ -n "$WITHOUT_CURL" ]; then sudo apt-get install curl -y ; fi +jobs: + include: + - env: SHELL=bash TEST_SUITE=xenial + dist: xenial + - env: SHELL=sh TEST_SUITE=xenial + dist: xenial + - env: SHELL=dash TEST_SUITE=xenial + dist: xenial + - env: SHELL=zsh TEST_SUITE=xenial + dist: xenial + #- env: SHELL=ksh TEST_SUITE=xenial + # dist: xenial env: global: - CXX=g++ diff --git a/test/installation_node/install from source b/test/installation_node/install from source index d458c87..29fe1cd 100755 --- a/test/installation_node/install from source +++ b/test/installation_node/install from source @@ -12,7 +12,7 @@ nvm deactivate || die 'deactivate failed' nvm unalias default || die 'unable to unalias default' -NVM_TEST_VERSION=v0.10.7 +NVM_TEST_VERSION=v18.0.0 # Remove the stuff we're clobbering. nvm uninstall "${NVM_TEST_VERSION}" || die 'nvm uninstall failed' diff --git a/test/installation_node/install from source with thread parameter b/test/installation_node/install from source with thread parameter index 1b3faae..240abaf 100755 --- a/test/installation_node/install from source with thread parameter +++ b/test/installation_node/install from source with thread parameter @@ -4,7 +4,7 @@ die () { echo "$@" ; exit 1; } \. ../../nvm.sh -NVM_TEST_VERSION=v0.10.7 +NVM_TEST_VERSION=v18.0.0 # STAGE 1 # diff --git a/test/installation_node/install from source without V8 snapshot for ARM b/test/installation_node/install from source without V8 snapshot for ARM index fe8241d..3feb2e9 100755 --- a/test/installation_node/install from source without V8 snapshot for ARM +++ b/test/installation_node/install from source without V8 snapshot for ARM @@ -4,7 +4,7 @@ die () { echo "$@" ; exit 1; } \. ../../nvm.sh -NVM_TEST_VERSION=v0.10.7 +NVM_TEST_VERSION=v18.0.0 # Remove the stuff we're clobbering. [ -e ../../$NVM_TEST_VERSION ] && rm -R ../../$NVM_TEST_VERSION diff --git a/test/installation_node/install hook b/test/installation_node/install hook index 4290bb1..edfe718 100755 --- a/test/installation_node/install hook +++ b/test/installation_node/install hook @@ -4,7 +4,7 @@ die () { echo "$@" ; exit 1; } . ../../nvm.sh -VERSION='v0.11.0' +VERSION='v18.0.0' VERSION_PATH="$(nvm_version_path "${VERSION}")" succeed() { diff --git a/test/xenial/install from source b/test/xenial/install from source new file mode 100755 index 0000000..d458c87 --- /dev/null +++ b/test/xenial/install from source @@ -0,0 +1,29 @@ +#!/bin/sh + +set -ex + +die () { echo "$@" ; exit 1; } + +set +e # TODO: fix +\. ../../nvm.sh +set -e + +nvm deactivate || die 'deactivate failed' + +nvm unalias default || die 'unable to unalias default' + +NVM_TEST_VERSION=v0.10.7 + +# Remove the stuff we're clobbering. +nvm uninstall "${NVM_TEST_VERSION}" || die 'nvm uninstall failed' + +# Install from source +nvm install -s "${NVM_TEST_VERSION}" || die "'nvm install -s ${NVM_TEST_VERSION}' failed" + +# Check +[ -d ../../$NVM_TEST_VERSION ] || die "../../${NVM_TEST_VERSION} is not a directory" +nvm run $NVM_TEST_VERSION --version | grep $NVM_TEST_VERSION || "'nvm run ${NVM_TEST_VERSION} --version | grep ${NVM_TEST_VERSION}' failed" + +# ensure default is set +NVM_CURRENT_DEFAULT="$(nvm_alias default)" +[ "${NVM_CURRENT_DEFAULT}" = "${NVM_TEST_VERSION}" ] || die "wrong default alias: $(nvm alias)" diff --git a/test/installation_node/install from source implicitly b/test/xenial/install from source implicitly similarity index 100% rename from test/installation_node/install from source implicitly rename to test/xenial/install from source implicitly diff --git a/test/xenial/install from source with thread parameter b/test/xenial/install from source with thread parameter new file mode 100755 index 0000000..1b3faae --- /dev/null +++ b/test/xenial/install from source with thread parameter @@ -0,0 +1,33 @@ +#!/bin/sh + +die () { echo "$@" ; exit 1; } + +\. ../../nvm.sh + +NVM_TEST_VERSION=v0.10.7 + +# STAGE 1 # + +# Remove the stuff we're clobbering. +[ -e ../../$NVM_TEST_VERSION ] && rm -R ../../$NVM_TEST_VERSION + +# Install from source with 1 make job +nvm install -s -j 1 $NVM_TEST_VERSION || die "'nvm install -s $NVM_TEST_VERSION' failed" + +# Check +[ -d ../../$NVM_TEST_VERSION ] +nvm run $NVM_TEST_VERSION --version | grep $NVM_TEST_VERSION || "'nvm run $NVM_TEST_VERSION --version | grep $NVM_TEST_VERSION' failed" + + + +# STAGE 2 # + +# Remove the stuff we're clobbering. +[ -e ../../$NVM_TEST_VERSION ] && rm -R ../../$NVM_TEST_VERSION + +# Install from source with 2 make jobs (and swapped arg order) +nvm install -j 2 -s $NVM_TEST_VERSION || die "'nvm install -s $NVM_TEST_VERSION' failed" + +# Check +[ -d ../../$NVM_TEST_VERSION ] +nvm run $NVM_TEST_VERSION --version | grep $NVM_TEST_VERSION || "'nvm run $NVM_TEST_VERSION --version | grep $NVM_TEST_VERSION' failed" diff --git a/test/xenial/install from source without V8 snapshot for ARM b/test/xenial/install from source without V8 snapshot for ARM new file mode 100755 index 0000000..fe8241d --- /dev/null +++ b/test/xenial/install from source without V8 snapshot for ARM @@ -0,0 +1,25 @@ +#!/bin/sh + +die () { echo "$@" ; exit 1; } + +\. ../../nvm.sh + +NVM_TEST_VERSION=v0.10.7 + +# Remove the stuff we're clobbering. +[ -e ../../$NVM_TEST_VERSION ] && rm -R ../../$NVM_TEST_VERSION + +# Fake ARM arch +nvm_get_arch() { + echo "armv7l" +} + +# Install from source +nvm install -s $NVM_TEST_VERSION || die "'nvm install -s $NVM_TEST_VERSION' failed" + +# Check Install +[ -d ../../$NVM_TEST_VERSION ] +node --version | grep $NVM_TEST_VERSION || "'node --version | grep $NVM_TEST_VERSION' failed" + +# Check V8 snapshot isn't compiled +node -p "if(! process.config.variables.v8_use_snapshot) { console.log('no-snapshot'); }" | grep "no-snapshot" || "'node -p \"if(! process.config.variables.v8_use_snapshot) { console.log('no-snapshot'); }\" | grep \"no-snapshot\"' failed" diff --git a/test/xenial/install hook b/test/xenial/install hook new file mode 100755 index 0000000..4290bb1 --- /dev/null +++ b/test/xenial/install hook @@ -0,0 +1,45 @@ +#!/bin/sh + +die () { echo "$@" ; exit 1; } + +. ../../nvm.sh + +VERSION='v0.11.0' +VERSION_PATH="$(nvm_version_path "${VERSION}")" + +succeed() { + nvm_echo "$@" + NVM_INSTALL_THIRD_PARTY_HOOK= nvm install "${VERSION}" +} + +fail() { + succeed "$@" + return 11 +} + +! nvm_is_version_installed "${VERSION}" || nvm uninstall "${VERSION}" || die 'uninstall failed' + +# an existing but empty VERSION_PATH directory should not be enough to satisfy nvm_is_version_installed +rm -rf "${VERSION_PATH}" +mkdir -p "${VERSION_PATH}" +nvm_is_version_installed "${VERSION}" && die 'nvm_is_version_installed check not strict enough' +rmdir "${VERSION_PATH}" + +OUTPUT="$(NVM_INSTALL_THIRD_PARTY_HOOK=succeed nvm install "${VERSION}")" +USE_OUTPUT="$(nvm use "${VERSION}")" +EXPECTED_OUTPUT="${VERSION} node std binary ${VERSION_PATH} +Downloading and installing node ${VERSION}... +${USE_OUTPUT}" + +[ "${OUTPUT}" = "${EXPECTED_OUTPUT}" ] || die "expected >${EXPECTED_OUTPUT}<; got >${OUTPUT}<" + +! nvm_is_version_installed "${VERSION}" || nvm uninstall "${VERSION}" || die 'uninstall 2 failed' + +OUTPUT="$(NVM_INSTALL_THIRD_PARTY_HOOK=fail nvm install "${VERSION}" || echo 'failed')" +USE_OUTPUT="$(nvm use "${VERSION}")" +EXPECTED_OUTPUT="${VERSION} node std binary ${VERSION_PATH} +Downloading and installing node ${VERSION}... +${USE_OUTPUT} +failed" + +[ "${OUTPUT}" = "${EXPECTED_OUTPUT}" ] || die "expected >${EXPECTED_OUTPUT}<; got >${OUTPUT}<" diff --git a/test/installation_node/install version specified in .nvmrc from source b/test/xenial/install version specified in .nvmrc from source similarity index 100% rename from test/installation_node/install version specified in .nvmrc from source rename to test/xenial/install version specified in .nvmrc from source diff --git a/test/slow/node 0.6.21 should install 0.6.21-pre b/test/xenial/node 0.6.21 should install 0.6.21-pre similarity index 100% rename from test/slow/node 0.6.21 should install 0.6.21-pre rename to test/xenial/node 0.6.21 should install 0.6.21-pre