Skip to content
Myr

[Tests] make the fast suite pass on macOS

Before adoption: this commit came in with the history the project adopted, so no landing records it.

- `nvm_get_arch`: the unmocked smartos cases fall through to the host, so only run them on x86_64 - `nvm_get_arch_unofficial`: the chroot checks need x86_64 glibc Linux - `nvm_install_no_progress_bar`: derive the tarball slug and checksum tool instead of assuming linux-x64 and `sha256sum`

authored by Jordan Harband · committed by Jordan Harband · parent e2f57b7 · Browse files · 3 files+13 added−8 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

3 files+13 added−8 removed

  • tests:+13 added−8 removed

3 files+13 added−8 removed

modified:test/fast/Unit tests/nvm_get_arch+4 added-4 removed
88 unmodified lines
8990run_test x86 osx x8691run_test amd64 osx x649293# These smartos cases have no arch-specific uname mock, so nvm_get_os falls94# through to the real host; on Alpine that host is linux and picks up the musl95# suffix, which these non-musl assertions do not expect. Skip them there.96if [ ! -f "/etc/alpine-release" ]; then93# These smartos cases have no arch-specific uname mock, so they fall through to94# the real host: they only hold on an x86_64 host, and not on Alpine, where the95# host picks up the musl suffix these non-musl assertions do not expect.96if [ ! -f "/etc/alpine-release" ] && [ "$(command uname -m)" = 'x86_64' ]; then97 run_test arm64 smartos x6498 run_test armv8l smartos x6499fi100
3 unmodified lines
modified:test/fast/Unit tests/nvm_get_arch_unofficial+2 added
61 unmodified lines
62# nvm_get_arch's musl mapping is already covered by the "nvm_get_arch alpine"63# test, so skip the chroot checks there and still run the ls-remote checks.64if [ -f "/etc/alpine-release" ]; then65 echo "on Alpine; skipping chroot arch checks (covered by 'nvm_get_arch alpine')"66elif [ "$(command uname -s)" != 'Linux' ] || [ "$(command uname -m)" != 'x86_64' ] || [ ! -e /lib64/ld-linux-x86-64.so.2 ]; then67 echo "not on x86_64 glibc Linux; skipping chroot arch checks"68else69 setup_chroot "${CHROOT_WITH_ALPINE}"70 setup_chroot "${CHROOT_WITHOUT_ALPINE}"71
35 unmodified lines
modified:test/fast/Unit tests/nvm_install_no_progress_bar+7 added-4 removed
22 unmodified lines
23fi2425cleanup2627SLUG="$(nvm_get_download_slug node binary v0.12.18)"28CHECKSUM_LINE="$(nvm_compute_checksum ../../../nvm.sh 2>&1 >/dev/null)"2930OUTPUT="$(TERM=dumb 2>&1 nvm install --no-progress v0.12.18)"31EXPECTED_OUTPUT="Downloading and installing node v0.12.18...29Downloading https://nodejs.org/dist/v0.12.18/node-v0.12.18-linux-x64.tar.xz...30Computing checksum with sha256sum32Downloading https://nodejs.org/dist/v0.12.18/${SLUG}.tar.xz...33${CHECKSUM_LINE}34Checksums matched!35Now using node v0.12.18 (npm v2.15.11)36Creating default alias: default -> v0.12.18 *"37
4 unmodified lines
42cleanup4344OUTPUT="$(TERM=dumb 2>&1 nvm install v0.12.18)"45EXPECTED_OUTPUT="Downloading and installing node v0.12.18...43Downloading https://nodejs.org/dist/v0.12.18/node-v0.12.18-linux-x64.tar.xz...46Downloading https://nodejs.org/dist/v0.12.18/${SLUG}.tar.xz...47######################################################################### 100.0%45Computing checksum with sha256sum48${CHECKSUM_LINE}49Checksums matched!50Now using node v0.12.18 (npm v2.15.11)51Creating default alias: default -> v0.12.18 *"52
45 unmodified lines