@@ -16,20 +16,24 @@ const publishScriptNodeVersion = process.env.E2E_TEST_PUBLISH_SCRIPT_NODE_VERSIO
16
16
const DEFAULT_BUILD_TIMEOUT_SECONDS = 60 ;
17
17
const DEFAULT_TEST_TIMEOUT_SECONDS = 60 ;
18
18
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
+ }
20
24
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!' ) ;
26
27
}
27
28
28
- if ( ! authToken ) {
29
- console . log ( 'No auth token configured!' ) ;
29
+ if ( ! process . env . E2E_TEST_AUTH_TOKEN || ! process . env . E2E_TEST_DSN ) {
30
30
process . exit ( 1 ) ;
31
31
}
32
32
33
+ const envVarsToInject = {
34
+ REACT_APP_E2E_TEST_DSN : process . env . E2E_TEST_DSN ,
35
+ } ;
36
+
33
37
// https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#grouping-log-lines
34
38
function groupCIOutput ( groupTitle : string , fn : ( ) => void ) : void {
35
39
if ( process . env . CI ) {
@@ -159,6 +163,10 @@ const recipeResults: RecipeResult[] = recipePaths.map(recipePath => {
159
163
encoding : 'utf8' ,
160
164
shell : true , // needed so we can pass the build command in as whole without splitting it up into args
161
165
timeout : ( recipe . buildTimeoutSeconds ?? DEFAULT_BUILD_TIMEOUT_SECONDS ) * 1000 ,
166
+ env : {
167
+ ...process . env ,
168
+ ...envVarsToInject ,
169
+ } ,
162
170
} ) ;
163
171
164
172
// 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 => {
190
198
cwd : path . dirname ( recipePath ) ,
191
199
timeout : ( test . timeoutSeconds ?? DEFAULT_TEST_TIMEOUT_SECONDS ) * 1000 ,
192
200
encoding : 'utf8' ,
201
+ shell : true , // needed so we can pass the test command in as whole without splitting it up into args
193
202
env : {
194
203
...process . env ,
195
- E2E_TEST_AUTH_TOKEN : authToken ,
204
+ ... envVarsToInject ,
196
205
} ,
197
- shell : true , // needed so we can pass the test command in as whole without splitting it up into args
198
206
} ) ;
199
207
200
208
// Prepends some text to the output test command's output so we can distinguish it from logging in this script
0 commit comments