@@ -16,20 +16,24 @@ const publishScriptNodeVersion = process.env.E2E_TEST_PUBLISH_SCRIPT_NODE_VERSIO
1616const DEFAULT_BUILD_TIMEOUT_SECONDS = 60 ;
1717const DEFAULT_TEST_TIMEOUT_SECONDS = 60 ;
1818
19- let authToken = process . env . E2E_TEST_AUTH_TOKEN ;
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+ }
2024
21- try {
22- // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-var-requires
23- authToken = require ( path . resolve ( __dirname , 'auth-token.json' ) ) . authToken ;
24- } catch ( e ) {
25- console . log ( 'Failed to parse auth-token.json' ) ;
25+ if ( ! process . env . E2E_TEST_DSN ) {
26+ console . log ( 'No DSN configured! Please configure the E2E_TEST_DSN environment variable with a DSN!' ) ;
2627}
2728
28- if ( ! authToken ) {
29- console . log ( 'No auth token configured!' ) ;
29+ if ( ! process . env . E2E_TEST_AUTH_TOKEN || ! process . env . E2E_TEST_DSN ) {
3030 process . exit ( 1 ) ;
3131}
3232
33+ const envVarsToInject = {
34+ REACT_APP_E2E_TEST_DSN : process . env . E2E_TEST_DSN ,
35+ } ;
36+
3337// https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#grouping-log-lines
3438function groupCIOutput ( groupTitle : string , fn : ( ) => void ) : void {
3539 if ( process . env . CI ) {
@@ -159,6 +163,10 @@ const recipeResults: RecipeResult[] = recipePaths.map(recipePath => {
159163 encoding : 'utf8' ,
160164 shell : true , // needed so we can pass the build command in as whole without splitting it up into args
161165 timeout : ( recipe . buildTimeoutSeconds ?? DEFAULT_BUILD_TIMEOUT_SECONDS ) * 1000 ,
166+ env : {
167+ ...process . env ,
168+ ...envVarsToInject ,
169+ } ,
162170 } ) ;
163171
164172 // Prepends some text to the output build command's output so we can distinguish it from logging in this script
@@ -190,11 +198,11 @@ const recipeResults: RecipeResult[] = recipePaths.map(recipePath => {
190198 cwd : path . dirname ( recipePath ) ,
191199 timeout : ( test . timeoutSeconds ?? DEFAULT_TEST_TIMEOUT_SECONDS ) * 1000 ,
192200 encoding : 'utf8' ,
201+ shell : true , // needed so we can pass the test command in as whole without splitting it up into args
193202 env : {
194203 ...process . env ,
195- E2E_TEST_AUTH_TOKEN : authToken ,
204+ ... envVarsToInject ,
196205 } ,
197- shell : true , // needed so we can pass the test command in as whole without splitting it up into args
198206 } ) ;
199207
200208 // Prepends some text to the output test command's output so we can distinguish it from logging in this script
0 commit comments