File tree 1 file changed +22
-3
lines changed
1 file changed +22
-3
lines changed Original file line number Diff line number Diff line change 5
5
set +o pipefail
6
6
7
7
EXIT_STATE=0
8
+ MAX_AUTO_RETRY=5
9
+
10
+ # inspired by https://unix.stackexchange.com/a/82602
11
+ retry () {
12
+ local n=0
13
+
14
+ until [ $n -ge $MAX_AUTO_RETRY ]; do
15
+ " $@ " && break
16
+ n=$[$n +1]
17
+ echo ' '
18
+ echo run $n of $MAX_AUTO_RETRY failed, trying again ...
19
+ echo ' '
20
+ sleep 15
21
+ done
22
+
23
+ if [ $n -eq $MAX_AUTO_RETRY ]; then
24
+ EXIT_STATE=1
25
+ fi
26
+ }
8
27
9
28
case $1 in
10
29
11
30
jasmine)
12
- npm run test-jasmine -- --skip-tags=gl,noCI || EXIT_STATE= $?
31
+ retry npm run test-jasmine -- --skip-tags=gl,noCI
13
32
exit $EXIT_STATE
14
33
;;
15
34
16
35
jasmine2)
17
- npm run test-jasmine -- --tags=gl --skip-tags=noCI || EXIT_STATE= $?
18
- npm run test-bundle || EXIT_STATE= $?
36
+ retry npm run test-jasmine -- --tags=gl --skip-tags=noCI
37
+ retry npm run test-bundle
19
38
exit $EXIT_STATE
20
39
;;
21
40
You can’t perform that action at this time.
0 commit comments