-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathtest.sh
executable file
·52 lines (41 loc) · 865 Bytes
/
test.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/bin/bash
. ~/.nvm/nvm.sh
. ~/.bashrc
declare -a VERSIONS=("14" "15" "16" "18" "20")
if [ $# -eq 1 ]
then
VERSIONS=($1)
echo "Single version, no stress test"
fi
if [ $# -eq 2 ]
then
VERSIONS=($1)
APIKEY=$2
echo "Single version, running stress"
fi
echo ${VERSIONS[@]}
for nodeversion in ${VERSIONS[@]}
do
nvm install $nodeversion
rm -Rf node_modules
nvm exec $nodeversion npm install
echo
echo "Test functionality"
time nvm exec $nodeversion node test/functionality
if [ $? -eq 0 ]
then
echo "Passed"
else
echo "Aborting"
exit 1
fi
echo
echo "Test performance"
time nvm exec $nodeversion node test/performance
if [ $# -eq 2 ]
then
echo
echo "Stress test starting"
nvm exec $nodeversion node test/stress ${APIKEY}
fi
done