Skip to content

Commit 18515f8

Browse files
committed
update
1 parent c0d2d1c commit 18515f8

File tree

4 files changed

+25
-41
lines changed

4 files changed

+25
-41
lines changed

.travis.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,15 @@ install:
2121
- if [ -z "${SHELLCHECK-}" ]; then nvm install node && npm install && npm prune && npm ls urchin doctoc eclint dockerfile_lint; fi
2222
- '[ -z "$WITHOUT_CURL" ] || sudo apt-get remove curl -y'
2323
script:
24-
- 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
24+
- >
25+
if [ -n "${SHELL-}" ] && [ -n "${TEST_SUITE}" ]; then
26+
set -x
27+
if [ "${TEST_SUITE}" = 'installation_iojs' ]; then
28+
travis_retry make TEST_SUITE=$TEST_SUITE URCHIN="$(npm bin)/urchin" test-$SHELL
29+
else
30+
make --debug=v TEST_SUITE=$TEST_SUITE URCHIN="$(npm bin)/urchin" test-$SHELL
31+
fi
32+
fi
2533
before_cache:
2634
- if [ -n "$WITHOUT_CURL" ]; then sudo apt-get install curl -y ; fi
2735
env:

test/install_script/nvm_do_install

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,5 @@ NVM_ENV=testing \. ../../install.sh
66

77
#nvm_do_install is available
88
type nvm_do_install > /dev/null 2>&1 || die 'nvm_do_install is not available'
9+
10+
die 'I want to fail !!!'

test/install_script/nvm_source

Lines changed: 4 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,10 @@
11
#!/bin/sh
22

3-
set -ex
4-
5-
cleanup () {
6-
unset -f die cleanup
7-
unset NVM_SOURCE out
8-
}
9-
die () { echo "$@" ; cleanup ; exit 1; }
3+
die () { echo "$@" ; exit 1; }
104

115
NVM_ENV=testing \. ../../install.sh
126

13-
# nvm_source with no parameter returns the git endpoint
14-
echo $(nvm_source) | grep "https://github.com/nvm-sh/nvm.git$" > /dev/null || die "nvm_source without arguments should return the location of the git repo"
15-
[ "$(nvm_source)" = "https://github.com/nvm-sh/nvm.git" ] || die "nvm_source without arguments should return the location of the git repo"
16-
NVM_GITHUB_REPO="other-user/other-nvm" echo $(nvm_source) | grep "https://github.com/other-user/other-nvm.git$" > /dev/null || die "nvm_source without arguments should return the location of the git repo"
17-
18-
# nvm_source with git parameter returns the location of the nvm repo
19-
echo $(nvm_source "git") | grep "https://github.com/nvm-sh/nvm.git$" > /dev/null || die "nvm_source without arguments should return the location of the git repo"
20-
NVM_GITHUB_REPO="other-user/other-nvm" echo $(nvm_source "git") | grep "https://github.com/other-user/other-nvm.git$" > /dev/null || die "nvm_source without arguments should return the location of the git repo"
21-
22-
# nvm_source with script parameter returns the location of nvm.sh
23-
echo $(nvm_source "script") | grep "https://raw.githubusercontent.com/nvm-sh/nvm/$(nvm_latest_version)/nvm.sh$" > /dev/null || die "nvm_source \"script\" should return the location of nvm.sh"
24-
NVM_GITHUB_REPO="other-user/other-nvm" NVM_INSTALL_VERSION="v0.37.2" echo $(nvm_source "script") | grep "https://raw.githubusercontent.com/other-user/other-nvm/v0.37.2/nvm.sh$" > /dev/null || die "nvm_source \"script\" should return the location of nvm.sh"
25-
26-
# nvm_source with script-nvm-exec parameter returns the location of nvm-exec
27-
echo $(nvm_source "script-nvm-exec") | grep "https://raw.githubusercontent.com/nvm-sh/nvm/$(nvm_latest_version)/nvm-exec$" > /dev/null || die "nvm_source \"script-nvm-exec\" should return the location of nvm.sh"
28-
NVM_GITHUB_REPO="other-user/other-nvm" NVM_INSTALL_VERSION="v0.37.2" echo $(nvm_source "script-nvm-exec") | grep "https://raw.githubusercontent.com/other-user/other-nvm/v0.37.2/nvm-exec$" > /dev/null || die "nvm_source \"script-nvm-exec\" should return the location of nvm.sh"
29-
30-
# nvm_source with any other parameter errors out and exits
31-
nvm_source "anything" 2> /dev/null && die "nvm_source with invalid parameter should exit"
32-
out=$(nvm_source "anything" 2>&1 >/dev/null) || : #Saving the process here
33-
[ -z "$out" ] && die "nvm_source with invalid parameter should error out"
34-
35-
#nvm_source should always return NVM_SOURCE no matter the parameters
36-
NVM_SOURCE="my_location"
37-
out=$(nvm_source)
38-
[ "_$out" = "_my_location" ] || die "nvm_source without arguments should have returned \$NVM_SOURCE. Got \"$out\""
39-
out=$(nvm_source "git")
40-
[ "_$out" = "_my_location" ] || die "nvm_source git should have returned \$NVM_SOURCE. Got \"$out\""
41-
out=$(nvm_source "script")
42-
[ "_$out" = "_my_location" ] || die "nvm_source script should have returned \$NVM_SOURCE. Got \"$out\""
43-
out=$(nvm_source "anything")
44-
[ "_$out" = "_my_location" ] || die "nvm_source script should have returned \$NVM_SOURCE. Got \"$out\""
7+
#nvm_do_install is available
8+
type nvm_do_install > /dev/null 2>&1 || die 'nvm_do_install is not available'
459

46-
cleanup
10+
die 'I want to fail !!!'

test/install_script/nvm_source_copy

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/bin/sh
2+
3+
die () { echo "$@" ; exit 1; }
4+
5+
NVM_ENV=testing \. ../../install.sh
6+
7+
#nvm_do_install is available
8+
type nvm_do_install > /dev/null 2>&1 || die 'nvm_do_install is not available'
9+
10+
die 'I want to fail !!!'

0 commit comments

Comments
 (0)