@@ -13,9 +13,27 @@ const PUBLISH_PACKAGES_DOCKER_IMAGE_NAME = 'publish-packages';
13
13
14
14
const publishScriptNodeVersion = process . env . E2E_TEST_PUBLISH_SCRIPT_NODE_VERSION ;
15
15
16
- const DEFAULT_BUILD_TIMEOUT_SECONDS = 60 ;
16
+ const DEFAULT_BUILD_TIMEOUT_SECONDS = 60 * 5 ;
17
17
const DEFAULT_TEST_TIMEOUT_SECONDS = 60 ;
18
18
19
+ if ( ! process . env . E2E_TEST_AUTH_TOKEN ) {
20
+ console . log (
21
+ "No auth token configured! Please configure the E2E_TEST_AUTH_TOKEN environment variable with an auth token that has the scope 'project:read'!" ,
22
+ ) ;
23
+ }
24
+
25
+ if ( ! process . env . E2E_TEST_DSN ) {
26
+ console . log ( 'No DSN configured! Please configure the E2E_TEST_DSN environment variable with a DSN!' ) ;
27
+ }
28
+
29
+ if ( ! process . env . E2E_TEST_AUTH_TOKEN || ! process . env . E2E_TEST_DSN ) {
30
+ process . exit ( 1 ) ;
31
+ }
32
+
33
+ const envVarsToInject = {
34
+ REACT_APP_E2E_TEST_DSN : process . env . E2E_TEST_DSN ,
35
+ } ;
36
+
19
37
// https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#grouping-log-lines
20
38
function groupCIOutput ( groupTitle : string , fn : ( ) => void ) : void {
21
39
if ( process . env . CI ) {
@@ -145,13 +163,32 @@ const recipeResults: RecipeResult[] = recipePaths.map(recipePath => {
145
163
encoding : 'utf8' ,
146
164
shell : true , // needed so we can pass the build command in as whole without splitting it up into args
147
165
timeout : ( recipe . buildTimeoutSeconds ?? DEFAULT_BUILD_TIMEOUT_SECONDS ) * 1000 ,
166
+ env : {
167
+ ...process . env ,
168
+ ...envVarsToInject ,
169
+ } ,
148
170
} ) ;
149
171
150
172
// Prepends some text to the output build command's output so we can distinguish it from logging in this script
151
173
console . log ( buildCommandProcess . stdout . replace ( / ^ / gm, '[BUILD OUTPUT] ' ) ) ;
152
174
console . log ( buildCommandProcess . stderr . replace ( / ^ / gm, '[BUILD OUTPUT] ' ) ) ;
153
175
154
- if ( buildCommandProcess . status !== 0 ) {
176
+ const error : undefined | ( Error & { code ?: string } ) = buildCommandProcess . error ;
177
+
178
+ if ( error ?. code === 'ETIMEDOUT' ) {
179
+ processShouldExitWithError = true ;
180
+
181
+ printCIErrorMessage (
182
+ `Build command in test application "${ recipe . testApplicationName } " (${ path . dirname ( recipePath ) } ) timed out!` ,
183
+ ) ;
184
+
185
+ return {
186
+ testApplicationName : recipe . testApplicationName ,
187
+ testApplicationPath : recipePath ,
188
+ buildFailed : true ,
189
+ testResults : [ ] ,
190
+ } ;
191
+ } else if ( buildCommandProcess . status !== 0 ) {
155
192
processShouldExitWithError = true ;
156
193
157
194
printCIErrorMessage (
@@ -177,6 +214,10 @@ const recipeResults: RecipeResult[] = recipePaths.map(recipePath => {
177
214
timeout : ( test . timeoutSeconds ?? DEFAULT_TEST_TIMEOUT_SECONDS ) * 1000 ,
178
215
encoding : 'utf8' ,
179
216
shell : true , // needed so we can pass the test command in as whole without splitting it up into args
217
+ env : {
218
+ ...process . env ,
219
+ ...envVarsToInject ,
220
+ } ,
180
221
} ) ;
181
222
182
223
// Prepends some text to the output test command's output so we can distinguish it from logging in this script
0 commit comments