File tree Expand file tree Collapse file tree 2 files changed +31
-12
lines changed Expand file tree Collapse file tree 2 files changed +31
-12
lines changed Original file line number Diff line number Diff line change 1- name : End-to-End Tests
1+ name : End-to-End Tests V2
22
33on :
44 push :
Original file line number Diff line number Diff line change @@ -234,16 +234,35 @@ if (actions.includes('test')) {
234234 if ( ! sentryAuthToken ) {
235235 console . log ( 'Skipping maestro test due to unavailable or empty SENTRY_AUTH_TOKEN' ) ;
236236 } else {
237- execSync (
238- `maestro test maestro \
239- --env=APP_ID="${ appId } " \
240- --env=SENTRY_AUTH_TOKEN="${ sentryAuthToken } " \
241- --debug-output maestro-logs \
242- --flatten-debug-output` ,
243- {
244- stdio : 'inherit' ,
245- cwd : e2eDir ,
246- } ,
247- ) ;
237+ try {
238+ execSync (
239+ `maestro test maestro \
240+ --env=APP_ID="${ appId } " \
241+ --env=SENTRY_AUTH_TOKEN="${ sentryAuthToken } " \
242+ --debug-output maestro-logs \
243+ --flatten-debug-output` ,
244+ {
245+ stdio : 'inherit' ,
246+ cwd : e2eDir ,
247+ } ,
248+ ) ;
249+ } finally {
250+ // Always redact sensitive data, even if the test fails
251+ const redactScript = `
252+ if [[ "$(uname)" == "Darwin" ]]; then
253+ find ./maestro-logs -type f -exec sed -i '' "s/${ sentryAuthToken } /[REDACTED]/g" {} +
254+ echo 'Redacted sensitive data from logs on MacOS'
255+ else
256+ find ./maestro-logs -type f -exec sed -i "s/${ sentryAuthToken } /[REDACTED]/g" {} +
257+ echo 'Redacted sensitive data from logs on Ubuntu'
258+ fi
259+ ` ;
260+
261+ try {
262+ execSync ( redactScript , { stdio : 'inherit' , cwd : e2eDir , shell : '/bin/bash' } ) ;
263+ } catch ( error ) {
264+ console . warn ( 'Failed to redact sensitive data from logs:' , error . message ) ;
265+ }
266+ }
248267 }
249268}
You can’t perform that action at this time.
0 commit comments