@@ -13,9 +13,27 @@ const PUBLISH_PACKAGES_DOCKER_IMAGE_NAME = 'publish-packages';
1313
1414const publishScriptNodeVersion = process . env . E2E_TEST_PUBLISH_SCRIPT_NODE_VERSION ;
1515
16- const DEFAULT_BUILD_TIMEOUT_SECONDS = 60 ;
16+ const DEFAULT_BUILD_TIMEOUT_SECONDS = 60 * 5 ;
1717const DEFAULT_TEST_TIMEOUT_SECONDS = 60 ;
1818
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+
1937// https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#grouping-log-lines
2038function groupCIOutput ( groupTitle : string , fn : ( ) => void ) : void {
2139 if ( process . env . CI ) {
@@ -145,13 +163,32 @@ const recipeResults: RecipeResult[] = recipePaths.map(recipePath => {
145163 encoding : 'utf8' ,
146164 shell : true , // needed so we can pass the build command in as whole without splitting it up into args
147165 timeout : ( recipe . buildTimeoutSeconds ?? DEFAULT_BUILD_TIMEOUT_SECONDS ) * 1000 ,
166+ env : {
167+ ...process . env ,
168+ ...envVarsToInject ,
169+ } ,
148170 } ) ;
149171
150172 // Prepends some text to the output build command's output so we can distinguish it from logging in this script
151173 console . log ( buildCommandProcess . stdout . replace ( / ^ / gm, '[BUILD OUTPUT] ' ) ) ;
152174 console . log ( buildCommandProcess . stderr . replace ( / ^ / gm, '[BUILD OUTPUT] ' ) ) ;
153175
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 ) {
155192 processShouldExitWithError = true ;
156193
157194 printCIErrorMessage (
@@ -177,6 +214,10 @@ const recipeResults: RecipeResult[] = recipePaths.map(recipePath => {
177214 timeout : ( test . timeoutSeconds ?? DEFAULT_TEST_TIMEOUT_SECONDS ) * 1000 ,
178215 encoding : 'utf8' ,
179216 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+ } ,
180221 } ) ;
181222
182223 // Prepends some text to the output test command's output so we can distinguish it from logging in this script
0 commit comments