File tree Expand file tree Collapse file tree 4 files changed +30
-35
lines changed Expand file tree Collapse file tree 4 files changed +30
-35
lines changed Original file line number Diff line number Diff line change 33
33
# If first cmd executes successfully then execute second cmd
34
34
runIfSuccessful () {
35
35
echo " running: $1 "
36
- $( $1 > /dev/null)
36
+ $( $1 > /dev/null)
37
37
if [ $? -eq 0 ]; then
38
38
echo " running: $2 "
39
- $( $2 > /dev/null)
39
+ $( $2 > /dev/null)
40
40
fi
41
41
}
42
42
43
43
# Define max retries
44
- max_attempts=3;
45
- attempt_num=1;
44
+ max_attempts=3
45
+ attempt_num=1
46
46
47
47
arg1=" $1 "
48
48
arg2=" $2 "
49
49
50
- if [ $# -eq 1 ]
51
- then
50
+ if [ $# -eq 1 ]; then
52
51
cmd=" $arg1 "
53
52
else
54
53
cmd=" runIfSuccessful \" $arg1 \" \" $arg2 \" "
55
54
fi
56
55
57
- until eval $cmd
58
- do
59
- if (( attempt_num== max_attempts))
60
- then
61
- echo " Attempt $attempt_num / $max_attempts failed! No more retries left!"
62
- exit
63
- else
64
- echo " Attempt $attempt_num / $max_attempts failed!"
65
- sleep $(( attempt_num++ ))
66
- fi
56
+ until eval $cmd ; do
57
+ if (( attempt_num == max_attempts)) ; then
58
+ echo " Attempt $attempt_num / $max_attempts failed! No more retries left!"
59
+ exit 1
60
+ else
61
+ echo " Attempt $attempt_num / $max_attempts failed!"
62
+ sleep $(( attempt_num++ ))
63
+ fi
67
64
done
Original file line number Diff line number Diff line change @@ -40,8 +40,11 @@ describe('End-to-End Tests', () => {
40
40
`gcloud builds submit --project ${ GOOGLE_CLOUD_PROJECT } ` +
41
41
'--config ../renderer/test/e2e_test_setup.yaml ' +
42
42
`--substitutions _SERVICE=renderer-${ SERVICE_NAME } ,_REGION=${ REGION } ` ;
43
+
43
44
if ( SAMPLE_VERSION ) buildRendererCmd += `,_VERSION=${ SAMPLE_VERSION } ` ;
44
- if ( SERVICE_ACCOUNT ) buildRendererCmd += `,_SERVICE_ACCOUNT=${ SERVICE_ACCOUNT } ` ;
45
+ if ( SERVICE_ACCOUNT ) {
46
+ buildRendererCmd += `,_SERVICE_ACCOUNT=${ SERVICE_ACCOUNT } ` ;
47
+ }
45
48
46
49
console . log ( 'Starting Cloud Build for Renderer service...' ) ;
47
50
execSync ( buildRendererCmd , { cwd : '../renderer' } ) ;
Original file line number Diff line number Diff line change 33
33
# If first cmd executes successfully then execute second cmd
34
34
runIfSuccessful () {
35
35
echo " running: $1 "
36
- $( $1 > /dev/null)
36
+ $( $1 > /dev/null)
37
37
if [ $? -eq 0 ]; then
38
38
echo " running: $2 "
39
- $( $2 > /dev/null)
39
+ $( $2 > /dev/null)
40
40
fi
41
41
}
42
42
43
43
# Define max retries
44
- max_attempts=3;
45
- attempt_num=1;
44
+ max_attempts=3
45
+ attempt_num=1
46
46
47
47
arg1=" $1 "
48
48
arg2=" $2 "
49
49
50
- if [ $# -eq 1 ]
51
- then
50
+ if [ $# -eq 1 ]; then
52
51
cmd=" $arg1 "
53
52
else
54
53
cmd=" runIfSuccessful \" $arg1 \" \" $arg2 \" "
55
54
fi
56
55
57
- until eval $cmd
58
- do
59
- if (( attempt_num== max_attempts))
60
- then
61
- echo " Attempt $attempt_num / $max_attempts failed! No more retries left!"
62
- exit
63
- else
64
- echo " Attempt $attempt_num / $max_attempts failed!"
65
- sleep $(( attempt_num++ ))
66
- fi
56
+ until eval $cmd ; do
57
+ if (( attempt_num == max_attempts)) ; then
58
+ echo " Attempt $attempt_num / $max_attempts failed! No more retries left!"
59
+ exit 1
60
+ else
61
+ echo " Attempt $attempt_num / $max_attempts failed!"
62
+ sleep $(( attempt_num++ ))
63
+ fi
67
64
done
Original file line number Diff line number Diff line change @@ -33,7 +33,6 @@ describe('End-to-End Tests', () => {
33
33
const { SERVICE_ACCOUNT } = process . env ;
34
34
const REGION = 'us-central1' ;
35
35
36
-
37
36
let BASE_URL ;
38
37
before ( async ( ) => {
39
38
// Deploy service using Cloud Build
@@ -55,7 +54,6 @@ describe('End-to-End Tests', () => {
55
54
) ;
56
55
BASE_URL = url . toString ( 'utf-8' ) . trim ( ) ;
57
56
if ( ! BASE_URL ) throw Error ( 'Cloud Run service URL not found' ) ;
58
-
59
57
} ) ;
60
58
61
59
after ( ( ) => {
You can’t perform that action at this time.
0 commit comments