Skip to content

Commit 4384427

Browse files
cortisikoCal-L
andauthored
ci: migrate perf builds from bitrise to GHA (#28420)
<!-- Please submit this PR as a draft initially. Do not mark it as "Ready for review" until the template has been completely filled out, and PR status checks have passed at least once. --> ## **Description** > Performance E2E BrowserStack builds are migrated off Bitrise and onto GitHub Actions. The Android/iOS dual-build workflows now call the reusable build.yml workflow (instead of triggering/polling Bitrise), download the resulting APK/IPA artifacts, and upload them to BrowserStack while emitting BrowserStack URLs/app IDs/versions. > > Build variants and configs were reshaped for BrowserStack use. New builds.yml entries add dedicated BrowserStack build profiles for with SRP vs seedless onboarding (and exp vs e2e BrowserStack flavors), plus package.json scripts to target these build names; scripts/build.sh now honors IS_BROWSERSTACK_BUILD to avoid emulator-only settings (x86_64 arch restriction and IS_SIM_BUILD=true). > > Performance workflow triggering/variants were adjusted. run-performance-e2e-release.yml now runs on pushes only for metamaskbot version-bump commits and explicitly forces build_variant: rc, while the main performance workflow defaults build_variant to exp and updates concurrency grouping and conditional steps accordingly. ## **Changelog** <!-- If this PR is not End-User-Facing and should not show up in the CHANGELOG, you can choose to either: 1. Write `CHANGELOG entry: null` 2. Label with `no-changelog` If this PR is End-User-Facing, please write a short User-Facing description in the past tense like: `CHANGELOG entry: Added a new tab for users to see their NFTs` `CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker` (This helps the Release Engineer do their job more quickly and accurately) --> CHANGELOG entry: ## **Related issues** Fixes: ## **Manual testing steps** ```gherkin Feature: my feature name Scenario: user [verb for user action] Given [describe expected initial app state] When user [verb for user action] Then [describe expected outcome] ``` ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** <!-- [screenshots/recordings] --> ### **After** <!-- [screenshots/recordings] --> ## **Pre-merge author checklist** - [ ] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [ ] I've completed the PR template to the best of my ability - [ ] I've included tests if applicable - [ ] I've documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [ ] I've applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **Pre-merge reviewer checklist** - [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [ ] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Medium Risk** > Medium risk due to broad CI/build pipeline changes (workflows, build profiles, artifact handling) that can break build/upload automation or alter build-time flags for e2e/perf runs. > > **Overview** > **Moves Android/iOS “dual build + BrowserStack upload” workflows from Bitrise-trigger/polling to the reusable `build.yml` GitHub Actions workflow**, then downloads the resulting APK/IPA artifacts and uploads them to BrowserStack while emitting URLs/app IDs/versions. > > **Reshapes build variants and configs for BrowserStack/performance usage** by adding new `builds.yml` build profiles (e2e BrowserStack with/without SRP; RC/EXP with/without SRP), adding matching `package.json` build scripts, and teaching `scripts/build.sh` to honor `IS_BROWSERSTACK_BUILD` (skip emulator-only x86_64 restrictions and avoid forcing `IS_SIM_BUILD=true`). > > Updates performance/system workflows to default/validate `build_variant` including `e2e`, adjust concurrency grouping and gating (including release runs only on metamaskbot version-bump commits and forcing `build_variant: rc`), and adds `IS_PERFORMANCE_TEST` to disable E2E runtime overhead while keeping `E2E_MOCK_OAUTH` Metro mocks active; also includes small Playwright stability tweaks (hide keyboard) and hard-codes perf FF env to `test` for now. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 5c1e858. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY --> --------- Co-authored-by: Cal-L <cal.leung@consensys.net>
1 parent ec63474 commit 4384427

16 files changed

Lines changed: 458 additions & 967 deletions

.github/workflows/build-android-upload-to-browserstack.yml

Lines changed: 132 additions & 544 deletions
Large diffs are not rendered by default.

.github/workflows/build-ios-upload-to-browserstack.yml

Lines changed: 133 additions & 383 deletions
Large diffs are not rendered by default.

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -526,7 +526,7 @@ jobs:
526526
if-no-files-found: error
527527

528528
- name: Upload Android AAB
529-
if: matrix.platform == 'android' && env.CONFIGURATION != 'Debug'
529+
if: matrix.platform == 'android' && env.CONFIGURATION != 'Debug' && steps.rename.outputs.android_aab_path != ''
530530
uses: actions/upload-artifact@v4
531531
with:
532532
name: android-aab-${{ inputs.build_name }}

.github/workflows/performance-test-runner.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ on:
4343
build_variant:
4444
required: false
4545
type: string
46-
default: rc
47-
description: 'Build variant for app artifacts (rc or exp)'
46+
default: e2e
47+
description: 'Build variant for app artifacts (e2e, rc, or exp)'
4848
secrets:
4949
BROWSERSTACK_USERNAME:
5050
required: true
@@ -172,8 +172,8 @@ jobs:
172172
SENTRY_ENVIRONMENT="github-actions-performance-e2e"
173173
BUILD_VARIANT="${{ inputs.build_variant }}"
174174
175-
if [[ "$BUILD_VARIANT" != "rc" && "$BUILD_VARIANT" != "exp" ]]; then
176-
echo "❌ Invalid build_variant '$BUILD_VARIANT'. Expected 'rc' or 'exp'."
175+
if [[ "$BUILD_VARIANT" != "rc" && "$BUILD_VARIANT" != "exp" && "$BUILD_VARIANT" != "e2e" ]]; then
176+
echo "❌ Invalid build_variant '$BUILD_VARIANT'. Expected 'e2e', 'rc', or 'exp'."
177177
exit 1
178178
fi
179179

.github/workflows/run-performance-e2e-release.yml

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,21 @@ jobs:
3737
- name: Check release trigger conditions
3838
id: check
3939
run: |
40-
# Always run for manual dispatch or release branch pushes
41-
if [[ "${{ github.event_name }}" == "workflow_dispatch" || ("${{ github.event_name }}" == "push" && "${{ github.ref_name }}" =~ ^release/) ]]; then
40+
# Always run for manual dispatch
41+
if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
4242
echo "should-run=true" >> "$GITHUB_OUTPUT"
43-
echo "Performance tests triggered by ${{ github.event_name }}"
43+
echo "Performance tests triggered by manual dispatch"
44+
# For push events, only run if the triggering commit is a metamaskbot version bump
45+
elif [[ "${{ github.event_name }}" == "push" ]]; then
46+
COMMIT_MESSAGE=$(git log -1 --format="%s" "${{ github.sha }}")
47+
COMMIT_AUTHOR=$(git log -1 --format="%ae" "${{ github.sha }}")
48+
if [[ "$COMMIT_MESSAGE" =~ "Bump version number" && "$COMMIT_AUTHOR" =~ ^metamaskbot@ ]]; then
49+
echo "should-run=true" >> "$GITHUB_OUTPUT"
50+
echo "Push triggered by metamaskbot version bump: $COMMIT_MESSAGE"
51+
else
52+
echo "should-run=false" >> "$GITHUB_OUTPUT"
53+
echo "Push is not a metamaskbot version bump — skipping. Author: $COMMIT_AUTHOR | Message: $COMMIT_MESSAGE"
54+
fi
4455
# For scheduled runs, check for recent metamaskbot version bumps
4556
elif [[ "${{ github.event_name }}" == "schedule" ]]; then
4657
git fetch --all
@@ -55,13 +66,11 @@ jobs:
5566
# Check if the commit message contains "Bump version number" (ignore [skip ci])
5667
COMMIT_MESSAGE=$(git log -1 --format="%s" "$COMMIT_HASH")
5768
if [[ "$COMMIT_MESSAGE" =~ "Bump version number" ]]; then
58-
# Check if we've already processed this commit by looking for a workflow run with this commit
59-
# We'll use a simple approach: check if the commit is from the last 30 minutes
69+
# Only run if the commit is from the last 30 minutes (to avoid re-running the same commit)
6070
COMMIT_TIME=$(git log -1 --format="%ct" "$COMMIT_HASH")
6171
CURRENT_TIME=$(date +%s)
6272
TIME_DIFF=$((CURRENT_TIME - COMMIT_TIME))
6373
64-
# Only run if the commit is from the last 30 minutes (to avoid re-running the same commit)
6574
if [[ $TIME_DIFF -lt 1800 ]]; then
6675
echo "should-run=true" >> "$GITHUB_OUTPUT"
6776
echo "Recent metamaskbot version bump found (within last 30 min): $RECENT_VERSION_BUMP"
@@ -90,4 +99,5 @@ jobs:
9099
if: needs.check-release-trigger.outputs.should-run == 'true'
91100
with:
92101
sentry_target: ${{ inputs.sentry_target || 'test' }}
102+
build_variant: 'rc'
93103
secrets: inherit

.github/workflows/run-performance-e2e.yml

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ on:
88
push:
99
branches:
1010
- main
11-
- 'release/*'
1211
workflow_dispatch:
1312
inputs:
1413
description:
@@ -73,21 +72,21 @@ on:
7372
required: false
7473
type: string
7574
build_variant:
76-
description: 'Build variant for Bitrise (rc = release, exp = experimental)'
75+
description: 'Build variant (e2e = e2e environment, exp = experimental, rc = release)'
7776
required: false
7877
type: string
79-
default: 'rc'
78+
default: 'e2e'
8079

8180
permissions:
82-
contents: read
81+
contents: write
8382
id-token: write
8483
actions: write
8584

8685
concurrency:
87-
# Include build_variant so experimental (exp) and release/direct (rc) don't share the same
88-
# queue — avoids "Build Apps" (direct/release) and experimental runs canceling each other.
86+
# Include build_variant so e2e, experimental (exp), and release/direct (rc) don't share the same
87+
# queue — avoids "Build Apps" (direct/release) and e2e/experimental runs canceling each other.
8988
# Note: GitHub allows at most 1 running + 1 pending per group; a 3rd run cancels the pending one.
90-
group: performance-e2e-${{ github.ref }}-${{ github.event_name }}-${{ inputs.build_variant || 'rc' }}
89+
group: performance-e2e-${{ github.ref }}-${{ github.event_name }}-${{ inputs.build_variant || 'e2e' }}
9190
# Do not cancel in-progress runs; pending runs can still be replaced by a newer trigger.
9291
cancel-in-progress: false
9392

@@ -103,7 +102,7 @@ env:
103102

104103
jobs:
105104
determine-branch-name:
106-
name: Determine Branch Name for Bitrise
105+
name: Determine Branch Name
107106
runs-on: ubuntu-latest
108107
outputs:
109108
branch_name: ${{ steps.get-branch.outputs.branch_name }}
@@ -209,17 +208,17 @@ jobs:
209208
if: (!inputs.browserstack_app_url_android_onboarding && !inputs.browserstack_app_url_android_imported_wallet)
210209
with:
211210
branch_name: ${{ needs.determine-branch-name.outputs.branch_name }}
212-
build_variant: ${{ inputs.build_variant || 'rc' }}
211+
build_variant: ${{ inputs.build_variant || 'e2e' }}
213212
secrets: inherit
214213

215214
trigger-ios-dual-versions:
216215
name: Trigger iOS Dual Versions and Extract BrowserStack URLs
217216
uses: ./.github/workflows/build-ios-upload-to-browserstack.yml
218217
needs: [determine-branch-name]
219-
if: (!inputs.browserstack_app_url_ios_onboarding && !inputs.browserstack_app_url_ios_imported_wallet)
218+
if: false # temporarily disabled — iOS tests not yet active
220219
with:
221220
branch_name: ${{ needs.determine-branch-name.outputs.branch_name }}
222-
build_variant: ${{ inputs.build_variant || 'rc' }}
221+
build_variant: ${{ inputs.build_variant || 'e2e' }}
223222
secrets: inherit
224223

225224
# =============================================================================
@@ -241,7 +240,7 @@ jobs:
241240
platform: android
242241
build_type: onboarding
243242
sentry_target: ${{ inputs.sentry_target || 'test' }}
244-
build_variant: ${{ inputs.build_variant || 'rc' }}
243+
build_variant: ${{ inputs.build_variant || 'e2e' }}
245244
device_matrix: ${{ needs.read-device-matrix.outputs.android_matrix }}
246245
browserstack_app_url: ${{ needs.trigger-android-dual-versions.outputs.without-srp-browserstack-url || inputs.browserstack_app_url_android_onboarding }}
247246
app_version: ${{ needs.trigger-android-dual-versions.outputs.without-srp-version || 'Manual-Input' }}
@@ -264,7 +263,7 @@ jobs:
264263
platform: ios
265264
build_type: onboarding
266265
sentry_target: ${{ inputs.sentry_target || 'test' }}
267-
build_variant: ${{ inputs.build_variant || 'rc' }}
266+
build_variant: ${{ inputs.build_variant || 'e2e' }}
268267
device_matrix: ${{ needs.read-device-matrix.outputs.ios_matrix }}
269268
browserstack_app_url: ${{ needs.trigger-ios-dual-versions.outputs.without-srp-browserstack-url || inputs.browserstack_app_url_ios_onboarding }}
270269
app_version: ${{ needs.trigger-ios-dual-versions.outputs.without-srp-version || 'Manual-Input' }}
@@ -303,7 +302,7 @@ jobs:
303302
platform: android
304303
build_type: imported-wallet
305304
sentry_target: ${{ inputs.sentry_target || 'test' }}
306-
build_variant: ${{ inputs.build_variant || 'rc' }}
305+
build_variant: ${{ inputs.build_variant || 'e2e' }}
307306
device_matrix: ${{ needs.read-device-matrix.outputs.android_matrix }}
308307
browserstack_app_url: ${{ needs.trigger-android-dual-versions.outputs.with-srp-browserstack-url || inputs.browserstack_app_url_android_imported_wallet }}
309308
app_version: ${{ needs.trigger-android-dual-versions.outputs.with-srp-version || 'Manual-Input' }}
@@ -327,7 +326,7 @@ jobs:
327326
platform: ios
328327
build_type: imported-wallet
329328
sentry_target: ${{ inputs.sentry_target || 'test' }}
330-
build_variant: ${{ inputs.build_variant || 'rc' }}
329+
build_variant: ${{ inputs.build_variant || 'e2e' }}
331330
device_matrix: ${{ needs.read-device-matrix.outputs.ios_matrix }}
332331
browserstack_app_url: ${{ needs.trigger-ios-dual-versions.outputs.with-srp-browserstack-url || inputs.browserstack_app_url_ios_imported_wallet }}
333332
app_version: ${{ needs.trigger-ios-dual-versions.outputs.with-srp-version || 'Manual-Input' }}
@@ -339,7 +338,7 @@ jobs:
339338
name: Fetch RN Playground APK and Upload to BrowserStack
340339
runs-on: ubuntu-latest
341340
needs: [wait-for-onboarding-completion]
342-
if: always() && !cancelled() && (inputs.build_variant || 'rc') == 'rc'
341+
if: always() && !cancelled()
343342
outputs:
344343
browserstack-playground-url: ${{ steps.upload-playground.outputs.browserstack-url }}
345344
steps:
@@ -382,12 +381,12 @@ jobs:
382381
set-build-names,
383382
determine-branch-name,
384383
]
385-
if: always() && !cancelled() && (inputs.build_variant || 'rc') == 'rc' && (needs.trigger-android-dual-versions.result == 'skipped' || needs.trigger-android-dual-versions.result == 'success') && (inputs.browserstack_app_url_android_imported_wallet != '' || needs.trigger-android-dual-versions.outputs.with-srp-browserstack-url != '')
384+
if: always() && !cancelled() && (needs.trigger-android-dual-versions.result == 'skipped' || needs.trigger-android-dual-versions.result == 'success') && (inputs.browserstack_app_url_android_imported_wallet != '' || needs.trigger-android-dual-versions.outputs.with-srp-browserstack-url != '')
386385
with:
387386
platform: android
388387
build_type: mm-connect
389388
sentry_target: ${{ inputs.sentry_target || 'test' }}
390-
build_variant: ${{ inputs.build_variant || 'rc' }}
389+
build_variant: ${{ inputs.build_variant || 'e2e' }}
391390
device_matrix: ${{ needs.read-device-matrix.outputs.android_mm_connect_matrix }}
392391
browserstack_app_url: ${{ needs.trigger-android-dual-versions.outputs.with-srp-browserstack-url || inputs.browserstack_app_url_android_imported_wallet }}
393392
app_version: ${{ needs.trigger-android-dual-versions.outputs.with-srp-version || 'Manual-Input' }}
@@ -424,7 +423,7 @@ jobs:
424423
- name: Run aggregation script
425424
env:
426425
BRANCH_NAME: ${{ needs.determine-branch-name.outputs.branch_name }}
427-
BUILD_VARIANT: ${{ inputs.build_variant || 'rc' }}
426+
BUILD_VARIANT: ${{ inputs.build_variant || 'e2e' }}
428427
run: |
429428
echo "Processing all test results..."
430429
echo "Running aggregation script..."

.github/workflows/run-system-tests.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ jobs:
5353
&& !inputs.browserstack_clean_app_url_android)
5454
with:
5555
branch_name: ${{ github.ref_name }}
56+
build_variant: 'rc'
5657
secrets: inherit
5758

5859
trigger-ios-dual-versions:
@@ -64,6 +65,7 @@ jobs:
6465
&& !inputs.browserstack_clean_app_url_ios)
6566
with:
6667
branch_name: ${{ github.ref_name }}
68+
build_variant: 'rc'
6769
secrets: inherit
6870

6971
run-android-login-tests:

app/util/test/utils.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,13 @@ export const isTest =
3030
process.env.METAMASK_ENVIRONMENT !== 'beta' &&
3131
process.env.METAMASK_ENVIRONMENT !== 'rc' &&
3232
process.env.METAMASK_ENVIRONMENT !== 'exp';
33+
// IS_PERFORMANCE_TEST opts out of E2E runtime overhead (ReadOnlyNetworkStore,
34+
// command polling) while keeping METAMASK_ENVIRONMENT='e2e' so the build still
35+
// works on feature branches with e2e signing/secrets.
3336
export const isE2E =
34-
process.env.IS_TEST === 'true' || process.env.METAMASK_ENVIRONMENT === 'e2e';
37+
process.env.IS_PERFORMANCE_TEST !== 'true' &&
38+
(process.env.IS_TEST === 'true' ||
39+
process.env.METAMASK_ENVIRONMENT === 'e2e');
3540
export const enableApiCallLogs = process.env.LOG_API_CALLS === 'true';
3641
export const getFixturesServerPortInApp = () =>
3742
testConfig.fixtureServerPort ?? FALLBACK_FIXTURE_SERVER_PORT;

builds.yml

Lines changed: 109 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,83 @@ builds:
215215
secrets: *secrets
216216
code_fencing: *code_fencing_main
217217

218-
# Test builds (QA)
218+
# BrowserStack performance builds — seedless onboarding (E2E_MOCK_OAUTH baked in)
219+
# IS_PERFORMANCE_TEST suppresses E2E startup overhead (ReadOnlyNetworkStore, command
220+
# polling, Sentry mock) while keeping METAMASK_ENVIRONMENT='e2e' so this build works
221+
# on feature branches with the same github_environment/signing as all other e2e builds.
222+
# The seedless-onboarding controller is still mocked via E2E_MOCK_OAUTH.
223+
# E2E_BYOA_AUTH_SECRET is optional — QAMockOAuthService has a hardcoded default fallback.
224+
main-e2e-bs-without-srp:
225+
github_environment: build-e2e
226+
signing: *signing_uat
227+
env:
228+
<<: *public_envs
229+
METAMASK_ENVIRONMENT: 'e2e'
230+
METAMASK_BUILD_TYPE: 'main'
231+
IS_BROWSERSTACK_BUILD: 'true'
232+
DISABLE_NOTIFICATION_PROMPT: 'true'
233+
E2E_MOCK_OAUTH: 'true'
234+
IS_PERFORMANCE_TEST: 'true'
235+
RAMP_INTERNAL_BUILD: 'true'
236+
secrets: *secrets
237+
code_fencing: *code_fencing_main
238+
239+
# BrowserStack performance builds — with pre-imported wallet (ADDITIONAL_SRP_1 baked in)
240+
# IS_PERFORMANCE_TEST suppresses E2E startup overhead (ReadOnlyNetworkStore, command
241+
# polling, Sentry mock) while keeping METAMASK_ENVIRONMENT='e2e' so this build works
242+
# on feature branches with the same github_environment/signing as all other e2e builds.
243+
# The seedless-onboarding controller is still mocked via E2E_MOCK_OAUTH.
244+
main-e2e-bs-with-srp:
245+
github_environment: build-e2e
246+
signing: *signing_uat
247+
env:
248+
<<: *public_envs
249+
METAMASK_ENVIRONMENT: 'e2e'
250+
METAMASK_BUILD_TYPE: 'main'
251+
IS_BROWSERSTACK_BUILD: 'true'
252+
DISABLE_NOTIFICATION_PROMPT: 'true'
253+
E2E_MOCK_OAUTH: 'true'
254+
IS_PERFORMANCE_TEST: 'true'
255+
RAMP_INTERNAL_BUILD: 'true'
256+
secrets:
257+
<<: *secrets
258+
ADDITIONAL_SRP_1: 'IN_BUILD_SRP'
259+
PREDEFINED_PASSWORD: 'E2E_PASSWORD'
260+
code_fencing: *code_fencing_main
261+
# Release candidate with pre-imported wallet (system tests / performance tests)
262+
# Same as main-rc but bakes in ADDITIONAL_SRP_1 + PREDEFINED_PASSWORD so the app
263+
# starts with an imported wallet, skipping onboarding. Used by run-system-tests.yml.
264+
main-rc-with-srp:
265+
script_name: main-rc
266+
github_environment: build-rc
267+
signing: *signing_rc
268+
env:
269+
<<: *public_envs
270+
METAMASK_ENVIRONMENT: 'rc'
271+
METAMASK_BUILD_TYPE: 'main'
272+
secrets:
273+
<<: *secrets
274+
ADDITIONAL_SRP_1: 'IN_BUILD_SRP'
275+
PREDEFINED_PASSWORD: 'E2E_PASSWORD'
276+
code_fencing: *code_fencing_main
277+
278+
# Release candidate without pre-imported wallet — seedless onboarding (E2E_MOCK_OAUTH baked in)
279+
# RC counterpart to main-rc-with-srp; used by performance tests that exercise the onboarding flow.
280+
# E2E_BYOA_AUTH_SECRET is optional — QAMockOAuthService has a hardcoded default fallback.
281+
main-rc-without-srp:
282+
script_name: main-rc
283+
github_environment: build-rc
284+
signing: *signing_rc
285+
env:
286+
<<: *public_envs
287+
METAMASK_ENVIRONMENT: 'rc'
288+
METAMASK_BUILD_TYPE: 'main'
289+
DISABLE_NOTIFICATION_PROMPT: 'true'
290+
E2E_MOCK_OAUTH: 'true'
291+
secrets: *secrets
292+
code_fencing: *code_fencing_main
293+
294+
# Test builds
219295
main-test:
220296
github_environment: build-uat
221297
signing: *signing_uat
@@ -286,6 +362,38 @@ builds:
286362
secrets: *secrets
287363
code_fencing: *code_fencing_experimental
288364

365+
# BrowserStack experimental builds — with pre-imported wallet
366+
main-exp-with-srp:
367+
github_environment: build-exp
368+
signing: *signing_uat
369+
env:
370+
<<: *public_envs
371+
METAMASK_ENVIRONMENT: 'exp'
372+
METAMASK_BUILD_TYPE: 'main'
373+
DISABLE_NOTIFICATION_PROMPT: 'true'
374+
MM_ENABLE_SETTINGS_PAGE_DEV_OPTIONS: 'true'
375+
secrets:
376+
<<: *secrets
377+
ADDITIONAL_SRP_1: 'IN_BUILD_SRP'
378+
PREDEFINED_PASSWORD: 'E2E_PASSWORD'
379+
code_fencing: *code_fencing_experimental
380+
381+
# BrowserStack experimental builds — seedless onboarding (E2E_MOCK_OAUTH baked in)
382+
# E2E_BYOA_AUTH_SECRET is optional — QAMockOAuthService has a hardcoded default fallback.
383+
main-exp-without-srp:
384+
github_environment: build-exp
385+
signing: *signing_uat
386+
env:
387+
<<: *public_envs
388+
METAMASK_ENVIRONMENT: 'exp'
389+
METAMASK_BUILD_TYPE: 'main'
390+
DISABLE_NOTIFICATION_PROMPT: 'true'
391+
E2E_MOCK_OAUTH: 'true'
392+
MM_ENABLE_SETTINGS_PAGE_DEV_OPTIONS: 'true'
393+
secrets: *secrets
394+
code_fencing: *code_fencing_experimental
395+
396+
# Local development / Expo development build (Runway .app for simulator)
289397
# Dev release build (Ex. For sideloading via Build Mobile App workflow)
290398
main-dev:
291399
github_environment: build-dev

metro.config.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,14 +56,21 @@ module.exports = function (baseConfig) {
5656
const {
5757
resolver: { assetExts, sourceExts },
5858
} = defaultConfig;
59+
// IS_PERFORMANCE_TEST opts out of E2E startup overhead (ReadOnlyNetworkStore,
60+
// command polling, Sentry mock) while keeping METAMASK_ENVIRONMENT='e2e' so
61+
// the build still works on feature branches with e2e signing/secrets.
62+
const isPerformanceTest = process.env.IS_PERFORMANCE_TEST === 'true';
5963
const isE2E =
60-
process.env.IS_TEST === 'true' ||
61-
process.env.METAMASK_ENVIRONMENT === 'e2e';
64+
!isPerformanceTest &&
65+
(process.env.IS_TEST === 'true' ||
66+
process.env.METAMASK_ENVIRONMENT === 'e2e');
6267

6368
/**
6469
* E2E Metro redirects under tests/module-mocking.
6570
* Enables both: seedless-onboarding-controller + OAuthLoginHandlers mocks.
6671
* True when IS_TEST / METAMASK_ENVIRONMENT=e2e OR E2E_MOCK_OAUTH.
72+
* Performance builds set E2E_MOCK_OAUTH=true to keep this mock active
73+
* even though isE2E is false (preventing real OAuth calls to production).
6774
*/
6875
const isE2EMockOAuth = process.env.E2E_MOCK_OAUTH === 'true';
6976

0 commit comments

Comments
 (0)