Skip to content

Commit bb2ff00

Browse files
test: aligns the e2e MetaMask environment through builds and test runs (#20862)
<!-- 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** This PR aims to align the MetaMask environment on E2E context to the client distribution list and deprecate the use of `qa`. Passing run: https://github.com/MetaMask/metamask-mobile/actions/runs/18318391520?pr=20862 Builds on demand job was also cleaned and aligned to provide Flask build_type. <img width="399" height="398" alt="Screenshot 2025-10-08 at 11 20 08" src="https://github.com/user-attachments/assets/d0f7b838-e4e2-4360-9222-2470172bde50" /> <!-- Write a short description of the changes included in this pull request, also include relevant motivation and context. Have in mind the following questions: 1. What is the reason for the change? 2. What is the improvement/solution? --> ## **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] > Aligns E2E workflows to use `e2e` environment and refactors Android test build to accept `build_type` and `metamask_environment` with dynamic artifact paths; removes sourcemap upload. > > - **CI/E2E alignment**: > - Switch `metamask_environment` from `qa` to `e2e` in `ci.yml`, default in `run-e2e-workflow.yml`, and iOS build env in `test-ios-build-app.yml`. > - **Android test build workflow (`.github/workflows/test-android-build-app.yml`)**: > - Rename workflow and add inputs `metamask_environment` (default `e2e`) and `build_type` (`main`/`flask`). > - Parameterize setup target and build command: `yarn build:android:${{ inputs.build_type }}:${{ inputs.metamask_environment }}` with corresponding env vars. > - Add step to determine output paths/artifact names for `main` vs `flask`; update artifact upload names/paths accordingly. > - Add related secrets for Flask and `MM_INFURA_PROJECT_ID`; remove source map upload and its status line. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 89758da. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
1 parent 4e8a2c5 commit bb2ff00

File tree

4 files changed

+55
-25
lines changed

4 files changed

+55
-25
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ jobs:
266266
uses: ./.github/workflows/build-android-e2e.yml
267267
with:
268268
build_type: 'main'
269-
metamask_environment: 'qa'
269+
metamask_environment: 'e2e'
270270
keystore_target: 'qa'
271271
secrets: inherit
272272

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ on:
4242
description: 'The environment to build for'
4343
required: false
4444
type: string
45-
default: 'qa'
45+
default: 'e2e'
4646
changed_files:
4747
description: 'Changed files'
4848
required: false

.github/workflows/test-android-build-app.yml

Lines changed: 52 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Test Android Build QA App
1+
name: Test Android Build App
22

33

44
on:
@@ -9,6 +9,17 @@ on:
99
required: false
1010
default: '7'
1111
type: string
12+
metamask_environment:
13+
description: 'The environment to build for'
14+
required: false
15+
default: 'e2e'
16+
type: string
17+
build_type:
18+
description: 'The type of build to perform'
19+
required: false
20+
default: 'main'
21+
type: choice
22+
options: [main, flask]
1223

1324
permissions:
1425
contents: write
@@ -25,7 +36,6 @@ jobs:
2536
artifacts-url: ${{ steps.set-artifacts-url.outputs.artifacts-url }}
2637
apk-uploaded: ${{ steps.upload-apk.outcome == 'success' }}
2738
aab-uploaded: ${{ steps.upload-aab.outcome == 'success' }}
28-
sourcemap-uploaded: ${{ steps.upload-sourcemap.outcome == 'success' }}
2939
steps:
3040
# Get the source code from the repository
3141
- name: Checkout repo
@@ -43,8 +53,8 @@ jobs:
4353
with:
4454
platform: android
4555
setup-simulator: false
56+
target: ${{ inputs.build_type == 'main' && 'qa' || 'flask' }}
4657
configure-keystores: true
47-
target: qa
4858

4959
# Cache Gradle dependencies (most important for build speed)
5060
- name: Cache Gradle dependencies
@@ -109,18 +119,40 @@ jobs:
109119
echo "🚀 Finishing Android Setup..."
110120
yarn setup:github-ci --no-build-ios
111121
122+
- name: Determine target paths and Artifact Names
123+
id: determine-target-paths
124+
run: |
125+
if [[ "${{ inputs.build_type }}" == "flask" ]]; then
126+
{
127+
echo "apk-target-path=android/app/build/outputs/apk/flask/release"
128+
echo "test-apk-target-path=android/app/build/outputs/apk/androidTest/flask/release"
129+
echo "aab-target-path=android/app/build/outputs/bundle/flaskRelease"
130+
echo "artifact_name=app-flask-release"
131+
} >> "$GITHUB_OUTPUT"
132+
elif [[ "${{ inputs.build_type }}" == "main" ]]; then
133+
{
134+
echo "apk-target-path=android/app/build/outputs/apk/prod/release"
135+
echo "test-apk-target-path=android/app/build/outputs/apk/androidTest/prod/release"
136+
echo "aab-target-path=android/app/build/outputs/bundle/prodRelease"
137+
echo "artifact_name=app-prod-release"
138+
} >> "$GITHUB_OUTPUT"
139+
else
140+
echo "❌ Error: build_type ${{ inputs.build_type }} is not valid"
141+
exit 1
142+
fi
143+
112144
# Build the Android QA app (APK and AAB)
113145
- name: Build Android App
114146
run: |
115147
echo "🏗 Building Android APP..."
116148
export NODE_OPTIONS="--max-old-space-size=8192"
117149
cp android/gradle.properties.github android/gradle.properties
118-
yarn build:android:qa
150+
yarn build:android:${{ inputs.build_type }}:${{ inputs.metamask_environment }}
119151
shell: bash
120152
env:
121153
PLATFORM: android
122-
METAMASK_ENVIRONMENT: qa
123-
METAMASK_BUILD_TYPE: main
154+
METAMASK_ENVIRONMENT: ${{ inputs.metamask_environment }}
155+
METAMASK_BUILD_TYPE: ${{ inputs.build_type }}
124156
IS_TEST: true
125157
IGNORE_BOXLOGS_DEVELOPMENT: true
126158
GITHUB_CI: 'true'
@@ -129,28 +161,38 @@ jobs:
129161
NODE_OPTIONS: '--max-old-space-size=8192'
130162

131163
SEGMENT_WRITE_KEY_QA: ${{ secrets.SEGMENT_WRITE_KEY_QA }}
164+
SEGMENT_WRITE_KEY_FLASK: ${{ secrets.SEGMENT_WRITE_KEY_FLASK }}
132165
SEGMENT_PROXY_URL_QA: ${{ secrets.SEGMENT_PROXY_URL_QA }}
166+
SEGMENT_PROXY_URL_FLASK: ${{ secrets.SEGMENT_PROXY_URL_FLASK }}
133167
SEGMENT_DELETE_API_SOURCE_ID_QA: ${{ secrets.SEGMENT_DELETE_API_SOURCE_ID_QA }}
168+
SEGMENT_DELETE_API_SOURCE_ID_FLASK: ${{ secrets.SEGMENT_DELETE_API_SOURCE_ID_FLASK }}
134169
SEGMENT_REGULATIONS_ENDPOINT_QA: ${{ secrets.SEGMENT_REGULATIONS_ENDPOINT_QA }}
170+
SEGMENT_REGULATIONS_ENDPOINT_FLASK: ${{ secrets.SEGMENT_REGULATIONS_ENDPOINT_FLASK }}
135171

136172
MM_SENTRY_DSN_TEST: ${{ secrets.MM_SENTRY_DSN_TEST }}
137173
MM_SENTRY_AUTH_TOKEN: ${{ secrets.MM_SENTRY_AUTH_TOKEN }}
138174

139175
MAIN_IOS_GOOGLE_CLIENT_ID_UAT: ${{ secrets.MAIN_IOS_GOOGLE_CLIENT_ID_UAT }}
176+
FLASK_IOS_GOOGLE_CLIENT_ID_PROD: ${{ secrets.FLASK_IOS_GOOGLE_CLIENT_ID_PROD }}
140177
MAIN_IOS_GOOGLE_REDIRECT_URI_UAT: ${{ secrets.MAIN_IOS_GOOGLE_REDIRECT_URI_UAT }}
178+
FLASK_IOS_GOOGLE_REDIRECT_URI_PROD: ${{ secrets.FLASK_IOS_GOOGLE_REDIRECT_URI_PROD }}
141179
MAIN_ANDROID_APPLE_CLIENT_ID_UAT: ${{ secrets.MAIN_ANDROID_APPLE_CLIENT_ID_UAT }}
180+
FLASK_ANDROID_APPLE_CLIENT_ID_PROD: ${{ secrets.FLASK_ANDROID_APPLE_CLIENT_ID_PROD }}
142181
MAIN_ANDROID_GOOGLE_CLIENT_ID_UAT: ${{ secrets.MAIN_ANDROID_GOOGLE_CLIENT_ID_UAT }}
182+
FLASK_ANDROID_GOOGLE_CLIENT_ID_PROD: ${{ secrets.FLASK_ANDROID_GOOGLE_CLIENT_ID_PROD }}
143183
MAIN_ANDROID_GOOGLE_SERVER_CLIENT_ID_UAT: ${{ secrets.MAIN_ANDROID_GOOGLE_SERVER_CLIENT_ID_UAT }}
184+
FLASK_ANDROID_GOOGLE_SERVER_CLIENT_ID_PROD: ${{ secrets.FLASK_ANDROID_GOOGLE_SERVER_CLIENT_ID_PROD }}
144185
GOOGLE_SERVICES_B64_IOS: ${{ secrets.GOOGLE_SERVICES_B64_IOS }}
145186
GOOGLE_SERVICES_B64_ANDROID: ${{ secrets.GOOGLE_SERVICES_B64_ANDROID }}
187+
MM_INFURA_PROJECT_ID: ${{ secrets.MM_INFURA_PROJECT_ID }}
146188

147189
# Upload the Android APK file for device installation and testing
148190
- name: Upload Android APK Artifact
149191
id: upload-apk
150192
uses: actions/upload-artifact@v4
151193
with:
152-
name: app-qa-release.apk
153-
path: android/app/build/outputs/apk/qa/release/app-qa-release.apk
194+
name: ${{ inputs.build_type }}-${{ inputs.metamask_environment }}-release.apk
195+
path: ${{ steps.determine-target-paths.outputs.apk-target-path }}/${{ steps.determine-target-paths.outputs.artifact_name }}.apk
154196
retention-days: ${{ inputs.retention_days }}
155197
if-no-files-found: error
156198
continue-on-error: true
@@ -160,19 +202,8 @@ jobs:
160202
id: upload-aab
161203
uses: actions/upload-artifact@v4
162204
with:
163-
name: app-qa-release.aab
164-
path: android/app/build/outputs/bundle/qaRelease/app-qa-release.aab
165-
retention-days: ${{ inputs.retention_days }}
166-
if-no-files-found: warn
167-
continue-on-error: true
168-
169-
# Upload source map file for crash debugging and error tracking
170-
- name: Upload Android Source Map
171-
id: upload-sourcemap
172-
uses: actions/upload-artifact@v4
173-
with:
174-
name: index.android.bundle.map
175-
path: sourcemaps/android/index.android.bundle.map
205+
name: ${{ inputs.build_type }}-${{ inputs.metamask_environment }}-release.aab
206+
path: ${{ steps.determine-target-paths.outputs.aab-target-path }}/${{ steps.determine-target-paths.outputs.artifact_name }}.aab
176207
retention-days: ${{ inputs.retention_days }}
177208
if-no-files-found: warn
178209
continue-on-error: true
@@ -188,7 +219,6 @@ jobs:
188219
echo "Upload Status Summary:"
189220
echo "- 🤖 APK: ${{ steps.upload-apk.outcome }}"
190221
echo "- 📦 AAB Bundle: ${{ steps.upload-aab.outcome }}"
191-
echo "- 📦 Source Map: ${{ steps.upload-sourcemap.outcome }}"
192222
193223
env:
194224
GITHUB_REPOSITORY: '${{ github.repository }}'

.github/workflows/test-ios-build-app.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ jobs:
9090
shell: bash
9191
env:
9292
PLATFORM: ios
93-
METAMASK_ENVIRONMENT: qa
93+
METAMASK_ENVIRONMENT: e2e
9494
METAMASK_BUILD_TYPE: main
9595
IS_TEST: true
9696
IGNORE_BOXLOGS_DEVELOPMENT: true

0 commit comments

Comments
 (0)