3131 required : true
3232 type : string
3333 description : ' Unified BrowserStack build name for all sessions'
34+ sentry_target :
35+ required : false
36+ type : string
37+ default : test
38+ description : ' Sentry DSN target: test or real'
3439 secrets :
3540 BROWSERSTACK_USERNAME :
3641 required : true
4651 required : true
4752 E2E_PASSWORD :
4853 required : true
54+ MM_SENTRY_DSN_TEST :
55+ required : false
56+ MM_SENTRY_DSN :
57+ required : false
4958
5059jobs :
5160 run-tests :
5867 steps :
5968 - name : Checkout code
6069 uses : actions/checkout@v4
61-
70+
6271 - name : Restore node_modules cache
6372 id : cache
6473 uses : actions/cache@v4
@@ -70,13 +79,12 @@ jobs:
7079 key : ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
7180 restore-keys : |
7281 ${{ runner.os }}-yarn-
73-
82+
7483 - name : Set up Node.js
7584 uses : actions/setup-node@v4
7685 with :
7786 node-version-file : ' .nvmrc'
7887 cache : ' yarn'
79-
8088
8189 - name : Install dependencies
8290 uses : nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3.0.2
8593 max_attempts : 3
8694 retry_wait_seconds : 30
8795 command : yarn --immutable
88- # # This installs dependencies and creates the node_modules state file
89-
96+ # # This installs dependencies and creates the node_modules state file
9097 - name : Restore .metamask folder
9198 id : restore-metamask
9299 uses : actions/cache@v4
@@ -101,7 +108,7 @@ jobs:
101108 run : yarn setup:github-ci
102109 working-directory : ' .'
103110 # # This will apply the patches for appwright
104-
111+
105112 - name : BrowserStack Env Setup
106113 uses : browserstack/github-actions/setup-env@4478e16186f38e5be07721931642e65a028713c3
107114 with :
@@ -133,26 +140,52 @@ jobs:
133140 # Use same args for all build types. Do not use --include-hosts for mm-connect:
134141 # bs-local.com requests must be forwarded to localhost; --include-hosts can block them.
135142 local-args : ' --force-local --verbose'
136-
143+
137144 - name : Wait for BrowserStack Local
138145 run : |
139146 echo "Waiting for BrowserStack Local to be ready..."
140147 # mm-connect needs the tunnel ready so the device can reach bs-local.com:8090; allow extra time
141148 sleep ${{ inputs.build_type == 'mm-connect' && 15 || 10 }}
142149 echo "BrowserStack Local should be ready now"
143-
150+
144151 - name : Set Test Environment
145152 run : |
146153 echo "Setting ${{ inputs.build_type }} test environment for device: ${{ matrix.device.name }} (${{ matrix.device.category }} Class)"
147154 echo "OS Version: ${{ matrix.device.os_version }}"
148155 echo "Platform: ${{ inputs.platform }}"
149-
156+
157+ SENTRY_TARGET="${{ inputs.sentry_target }}"
158+ SENTRY_TEST_DSN="${{ secrets.MM_SENTRY_DSN_TEST }}"
159+ SENTRY_REAL_DSN="${{ secrets.MM_SENTRY_DSN }}"
160+ SELECTED_SENTRY_DSN=""
161+ SENTRY_ENVIRONMENT="github-actions-performance-e2e"
162+
150163 # Validate that we have a BrowserStack URL
151164 if [ -z "${{ inputs.browserstack_app_url }}" ]; then
152165 echo "❌ Error: No ${{ inputs.platform }} BrowserStack URL available"
153166 exit 1
154167 fi
155-
168+
169+ case "$SENTRY_TARGET" in
170+ real)
171+ SELECTED_SENTRY_DSN="$SENTRY_REAL_DSN"
172+ SENTRY_ENVIRONMENT="github-actions-performance-e2e-real"
173+ if [ -z "$SELECTED_SENTRY_DSN" ]; then
174+ echo "⚠️ MM_SENTRY_DSN is empty. Sentry uploads will be skipped."
175+ fi
176+ ;;
177+ test)
178+ SELECTED_SENTRY_DSN="$SENTRY_TEST_DSN"
179+ if [ -z "$SELECTED_SENTRY_DSN" ]; then
180+ echo "⚠️ MM_SENTRY_DSN_TEST is empty. Sentry uploads will be skipped."
181+ fi
182+ ;;
183+ *)
184+ echo "❌ Invalid sentry_target '$SENTRY_TARGET'. Expected 'test' or 'real'."
185+ exit 1
186+ ;;
187+ esac
188+
156189 {
157190 echo "BROWSERSTACK_DEVICE=${{ matrix.device.name }}"
158191 echo "BROWSERSTACK_OS_VERSION=${{ matrix.device.os_version }}"
@@ -167,9 +200,12 @@ jobs:
167200 echo "TEST_SRP_2=${{ secrets.TEST_SRP_2 }}"
168201 echo "TEST_SRP_3=${{ secrets.TEST_SRP_3 }}"
169202 echo "E2E_PASSWORD=${{ secrets.E2E_PASSWORD }}"
203+ echo "E2E_PERFORMANCE_SENTRY_DSN=$SELECTED_SENTRY_DSN"
204+ echo "E2E_PERFORMANCE_SENTRY_ENVIRONMENT=$SENTRY_ENVIRONMENT"
205+ echo "E2E_PERFORMANCE_SENTRY_RELEASE=${{ github.sha }}"
170206 echo "DISABLE_VIDEO_DOWNLOAD=true"
171207 } >> "$GITHUB_ENV"
172-
208+
173209 - name : Run Tests
174210 env :
175211 BROWSERSTACK_LOCAL : ' true'
@@ -183,7 +219,7 @@ jobs:
183219 echo "BrowserStack App URL: ${{ inputs.browserstack_app_url }}"
184220 echo "QA App Version: ${{ inputs.app_version }}"
185221 echo "BrowserStack Build Name: $BROWSERSTACK_BUILD_NAME"
186-
222+
187223 # Run the appropriate test command based on build_type flag
188224 if [ "${{ inputs.build_type }}" = "onboarding" ]; then
189225 yarn run-appwright:${{ inputs.platform }}-onboarding-bs
@@ -192,9 +228,9 @@ jobs:
192228 else
193229 yarn run-appwright:${{ inputs.platform }}-bs
194230 fi
195-
231+
196232 echo "✅ ${{ inputs.build_type }} tests completed for ${{ inputs.platform }} on ${{ matrix.device.name }}"
197-
233+
198234 - name : Upload Test Results
199235 uses : actions/upload-artifact@v4
200236 if : always()
0 commit comments