@@ -36,16 +36,12 @@ function printCIErrorMessage(message: string): void {
36
36
}
37
37
38
38
groupCIOutput ( 'Test Registry Setup' , ( ) => {
39
- try {
40
- // Stop test registry container (Verdaccio) if it was already running
41
- childProcess . spawnSync ( 'docker' , [ 'stop' , TEST_REGISTRY_CONTAINER_NAME ] , { stdio : 'ignore' } ) ;
42
- console . log ( 'Stopped previously running test registry' ) ;
43
- } catch ( e ) {
44
- // Don't throw if container wasn't running
45
- }
39
+ // Stop test registry container (Verdaccio) if it was already running
40
+ childProcess . spawnSync ( 'docker' , [ 'stop' , TEST_REGISTRY_CONTAINER_NAME ] , { stdio : 'ignore' } ) ;
41
+ console . log ( 'Stopped previously running test registry' ) ;
46
42
47
43
// Start test registry (Verdaccio)
48
- childProcess . spawnSync (
44
+ const startRegistryProcessResult = childProcess . spawnSync (
49
45
'docker' ,
50
46
[
51
47
'run' ,
@@ -62,8 +58,12 @@ groupCIOutput('Test Registry Setup', () => {
62
58
{ encoding : 'utf8' , stdio : 'inherit' } ,
63
59
) ;
64
60
61
+ if ( startRegistryProcessResult . status !== 0 ) {
62
+ process . exit ( 1 ) ;
63
+ }
64
+
65
65
// Build container image that is uploading our packages to fake registry with specific Node.js/npm version
66
- childProcess . spawnSync (
66
+ const buildPublishImageProcessResult = childProcess . spawnSync (
67
67
'docker' ,
68
68
[
69
69
'build' ,
@@ -80,8 +80,12 @@ groupCIOutput('Test Registry Setup', () => {
80
80
} ,
81
81
) ;
82
82
83
+ if ( buildPublishImageProcessResult . status !== 0 ) {
84
+ process . exit ( 1 ) ;
85
+ }
86
+
83
87
// Run container that uploads our packages to fake registry
84
- childProcess . spawnSync (
88
+ const publishImageContainerRunProcess = childProcess . spawnSync (
85
89
'docker' ,
86
90
[
87
91
'run' ,
@@ -97,6 +101,10 @@ groupCIOutput('Test Registry Setup', () => {
97
101
stdio : 'inherit' ,
98
102
} ,
99
103
) ;
104
+
105
+ if ( publishImageContainerRunProcess . status !== 0 ) {
106
+ process . exit ( 1 ) ;
107
+ }
100
108
} ) ;
101
109
102
110
groupCIOutput ( 'Run E2E Test Suites' , ( ) => {
@@ -119,11 +127,15 @@ groupCIOutput('Run E2E Test Suites', () => {
119
127
if ( recipe . buildCommand ) {
120
128
console . log ( `Running E2E test build command for test application "${ recipe . testApplicationName } "` ) ;
121
129
const [ buildCommand , ...buildCommandArgs ] = recipe . buildCommand . split ( ' ' ) ;
122
- childProcess . spawnSync ( buildCommand , buildCommandArgs , {
130
+ const buildCommandProcess = childProcess . spawnSync ( buildCommand , buildCommandArgs , {
123
131
cwd : path . dirname ( recipePath ) ,
124
132
encoding : 'utf8' ,
125
133
stdio : 'inherit' ,
126
134
} ) ;
135
+
136
+ if ( buildCommandProcess . status !== 0 ) {
137
+ process . exit ( 1 ) ;
138
+ }
127
139
}
128
140
129
141
type TestResult = {
0 commit comments