Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
127 commits
Select commit Hold shift + click to select a range
df552a4
test: refactor performance tests to skip onboarding
cortisiko Aug 27, 2025
60bb0f4
skip onboarding tests because iOS srp import is broken and we cannot …
cortisiko Aug 27, 2025
64a0c8f
Merge branch 'main' into e2e/enable-profiling-skip-onboarding-for-per…
cortisiko Aug 30, 2025
a49f1d4
Merge branch 'main' into e2e/enable-profiling-skip-onboarding-for-per…
cortisiko Sep 3, 2025
67589a6
fix login
cortisiko Sep 3, 2025
d638cf1
Merge branch 'main' into e2e/enable-profiling-skip-onboarding-for-per…
cortisiko Sep 4, 2025
97f9d5d
add profiling patch
cortisiko Sep 4, 2025
16957c2
attempt to run tests with onboarding + non onboarding
cortisiko Sep 4, 2025
f3c3d78
Revert "attempt to run tests with onboarding + non onboarding"
cortisiko Sep 5, 2025
1a6f752
only run tests that are non onboarding for now
cortisiko Sep 5, 2025
2c29275
disable slack notification
cortisiko Sep 5, 2025
b390a77
Merge branch 'main' into e2e/enable-profiling-skip-onboarding-for-per…
cortisiko Sep 8, 2025
e357d5f
use gha to build apps and run tests
cortisiko Sep 8, 2025
f2d95e5
make onboarding run onboarding and non onboarding run non onboarding
cortisiko Sep 8, 2025
d58ae5f
rename workflow
cortisiko Sep 8, 2025
48d045c
temporarily modifying workflow for android only runs
cortisiko Sep 8, 2025
de923d1
use the proper flag
cortisiko Sep 8, 2025
559098f
fix job
cortisiko Sep 8, 2025
cf92c72
match the build workflow
cortisiko Sep 8, 2025
f61b8c0
temp test
cortisiko Sep 8, 2025
07b9873
build fix
cortisiko Sep 8, 2025
426961d
fix script order
cortisiko Sep 8, 2025
3c148f3
need inherit
cortisiko Sep 8, 2025
6743b61
set is test to false
cortisiko Sep 8, 2025
df75b71
temporarily change arch
cortisiko Sep 8, 2025
935401b
find the correct build path
cortisiko Sep 9, 2025
539901e
use correct path
cortisiko Sep 9, 2025
efde9ee
dismiss perps bottom sheet
cortisiko Sep 9, 2025
eec4bf0
Merge branch 'main' into e2e/enable-profiling-skip-onboarding-for-per…
cortisiko Sep 9, 2025
3275106
set rn arch
cortisiko Sep 9, 2025
1f2539f
use a different gradle version
cortisiko Sep 9, 2025
d0ac65f
fix builds to trigger against bitrise
cortisiko Sep 9, 2025
8208e11
undo changes to gradle
cortisiko Sep 9, 2025
c778718
use bitrise secrets
cortisiko Sep 9, 2025
4b3e62a
fix builds for onboarding
cortisiko Sep 9, 2025
800e08f
disable perps tap to dismiss
cortisiko Sep 9, 2025
15014df
remove uncessary setup steps
cortisiko Sep 9, 2025
a9a3a62
account for get started screen missing
cortisiko Sep 10, 2025
dd11f8a
fix import
cortisiko Sep 10, 2025
442496c
change import account
cortisiko Sep 10, 2025
0de8dd4
clean up login scenarios
cortisiko Sep 10, 2025
902b794
clean up build
cortisiko Sep 10, 2025
43c8b66
revert changes
cortisiko Sep 10, 2025
a966262
Revert "clean up build"
cortisiko Sep 10, 2025
af0f926
Merge branch 'main' into e2e/enable-profiling-skip-onboarding-for-per…
cortisiko Sep 10, 2025
a86a61b
Merge branch 'main' into e2e/enable-profiling-skip-onboarding-for-per…
cortisiko Sep 11, 2025
65e2567
Merge branch 'main' into e2e/enable-profiling-skip-onboarding-for-per…
cortisiko Sep 11, 2025
16531e6
Enable performance builds hybrid approach (#19555)
cortisiko Sep 11, 2025
565423e
rename and remove unintended changes
cortisiko Sep 11, 2025
a8eceb4
fix lint issue
cortisiko Sep 11, 2025
9a0d025
remove unused
cortisiko Sep 11, 2025
b89965b
revert back to prod version
cortisiko Sep 11, 2025
88ed946
add back white space
cortisiko Sep 11, 2025
d4db017
clean up code
cortisiko Sep 11, 2025
6da3740
rename files for clarity
cortisiko Sep 11, 2025
3da3995
fix ci lint issues
cortisiko Sep 11, 2025
2855c29
use build prod script
cortisiko Sep 11, 2025
eaf5021
clean up some more
cortisiko Sep 11, 2025
e7af682
clena up spacing
cortisiko Sep 11, 2025
e2d1073
Revert "use build prod script"
cortisiko Sep 11, 2025
044f0e2
remove commented code
cortisiko Sep 11, 2025
f96082f
clean up code
cortisiko Sep 11, 2025
1f222dc
readd slack notification
cortisiko Sep 11, 2025
009b8e4
fix aggregated report
cortisiko Sep 11, 2025
d5a56b6
fix reports
cortisiko Sep 12, 2025
5034110
disable slack
cortisiko Sep 12, 2025
16442c9
Revert "disable slack"
cortisiko Sep 12, 2025
e2cec41
aggregate reports
cortisiko Sep 12, 2025
526001a
refactor performance workflow.
cortisiko Sep 12, 2025
79b7f0f
readd device matrix
cortisiko Sep 12, 2025
c90b20d
another attempt at device matrix
cortisiko Sep 12, 2025
c17e9f8
fix reports
cortisiko Sep 12, 2025
09edbad
make aggregated reports great again
cortisiko Sep 12, 2025
7035cbb
disable slack
cortisiko Sep 12, 2025
a17cdf7
downsize on workflow
cortisiko Sep 13, 2025
7766b6d
fix slack notification
cortisiko Sep 13, 2025
c039e8f
fix syntax error
cortisiko Sep 13, 2025
be20743
fix file path
cortisiko Sep 13, 2025
4855e59
fix permissions
cortisiko Sep 13, 2025
96da849
fix file name
cortisiko Sep 13, 2025
cf92c91
fix reading from json
cortisiko Sep 13, 2025
0be37f9
add the necessary secrets
cortisiko Sep 13, 2025
3ef8150
clean env variables
cortisiko Sep 13, 2025
6112b4f
fix aggregated report path
cortisiko Sep 13, 2025
e03da56
secrets fix
cortisiko Sep 13, 2025
8a8ccdf
Revert "secrets fix"
cortisiko Sep 13, 2025
7a49236
Revert "clean env variables"
cortisiko Sep 13, 2025
26e0881
env clean up again
cortisiko Sep 13, 2025
c6b83fd
dealing with env variables again
cortisiko Sep 13, 2025
46fe849
use env
cortisiko Sep 13, 2025
78d1a7e
less workers
cortisiko Sep 13, 2025
db8c04a
fix when job runs
cortisiko Sep 13, 2025
11713a4
starting back from scratch
cortisiko Sep 13, 2025
980d312
try again
cortisiko Sep 13, 2025
6f9fcd6
fix envs again
cortisiko Sep 13, 2025
2334f63
try running one build type per device
cortisiko Sep 13, 2025
4ab8332
reduce file size, use max paralell 1
cortisiko Sep 13, 2025
0b82907
fix aggregated report
cortisiko Sep 13, 2025
3956e1c
rename browserstack build name
cortisiko Sep 13, 2025
3a1659c
try triggering tests in consolidated jobs
cortisiko Sep 13, 2025
d27aea0
Revert "try triggering tests in consolidated jobs"
cortisiko Sep 13, 2025
c6e45e4
Revert "rename browserstack build name"
cortisiko Sep 13, 2025
8d10421
make onboarding tests run first then imported wallet because onboardi…
cortisiko Sep 13, 2025
913f703
fix aggregated report
cortisiko Sep 13, 2025
fd863ec
fix matrix
cortisiko Sep 13, 2025
1a599d9
try different matrix approach
cortisiko Sep 13, 2025
0c411e4
add job to wait for onboarding to finish.
cortisiko Sep 13, 2025
4072123
make device matrix better
cortisiko Sep 13, 2025
16695ca
use one build name, fix jobs
cortisiko Sep 13, 2025
4605941
attempt to fix aggregated report again
cortisiko Sep 14, 2025
eac7558
okay, this should fix the reports
cortisiko Sep 14, 2025
c898164
attempt at report again
cortisiko Sep 14, 2025
dc72241
fix reports again
cortisiko Sep 14, 2025
ddac451
reports reports reports
cortisiko Sep 14, 2025
2c59856
specify different bs url inputs
cortisiko Sep 14, 2025
741fb9d
fix conditional if bs urls are provided.
cortisiko Sep 14, 2025
6905151
make the workflow dispatch better. run only tests whenever specific u…
cortisiko Sep 14, 2025
6fa6792
clean up run performance e2e job
cortisiko Sep 14, 2025
f54b530
Merge branch 'main' into e2e/enable-profiling-skip-onboarding-for-per…
cortisiko Sep 14, 2025
03f8d71
update cache step with main
cortisiko Sep 14, 2025
1a83b37
fix linting issues
cortisiko Sep 14, 2025
add996b
delete unneeded workflow
cortisiko Sep 14, 2025
0f20026
readd name of workflow and schedule job
cortisiko Sep 14, 2025
d8fe09a
fix slack notification
cortisiko Sep 14, 2025
07f797a
fix slack notification formatting
cortisiko Sep 14, 2025
b87305f
remove artifact
cortisiko Sep 15, 2025
ee4d70c
lint issue
cortisiko Sep 15, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
275 changes: 275 additions & 0 deletions .github/workflows/build-android-upload-to-browserstack.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,275 @@
# This workflow creates two non E2E Android Builds and uploads to BrowserStack
# Build 1: With ADDITIONAL_SRP_1 and PREDEFINED_PASSWORD (pre-imported wallet)
# Build 2: Without these environment variables (fresh wallet)

name: Build Android Dual Versions and Upload to BrowserStack
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This workflow does 2 things:

builds the app for real devices (non-emulator)
then uploads it to browserstack


on:
workflow_call:
outputs:
with-srp-browserstack-url:
description: 'BrowserStack URL for with-SRP version'
value: ${{ jobs.upload-to-browserstack.outputs.with-srp-browserstack-url }}
without-srp-browserstack-url:
description: 'BrowserStack URL for without-SRP version'
value: ${{ jobs.upload-to-browserstack.outputs.without-srp-browserstack-url }}
with-srp-app-id:
description: 'BrowserStack App ID for with-SRP version'
value: ${{ jobs.upload-to-browserstack.outputs.with-srp-app-id }}
without-srp-app-id:
description: 'BrowserStack App ID for without-SRP version'
value: ${{ jobs.upload-to-browserstack.outputs.without-srp-app-id }}
with-srp-version:
description: 'App version for with-SRP build'
value: ${{ jobs.upload-to-browserstack.outputs.with-srp-version }}
without-srp-version:
description: 'App version for without-SRP build'
value: ${{ jobs.upload-to-browserstack.outputs.without-srp-version }}
workflow_dispatch:
inputs:
description:
description: 'Optional description for this build run'
required: false
type: string

permissions:
contents: read
id-token: write

env:
BROWSERSTACK_USERNAME: ${{ secrets.BROWSERSTACK_USERNAME }}
BROWSERSTACK_ACCESS_KEY: ${{ secrets.BROWSERSTACK_ACCESS_KEY }}

jobs:
build-android-dual:
name: Build Android Dual Versions
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the performance test, I am generating two builds so that we can test onboarding and non-onboarding scenarios

I reused the workflow to create the android builds here with the main exception being that I am not building with the IS_TEST set to true. We want to run the performance e2e against production.

runs-on: gha-mmsdk-scale-set-ubuntu-22.04-amd64-xl
env:
GRADLE_USER_HOME: /home/runner/_work/.gradle
# No outputs - these will be provided by the collect-results job

strategy:
fail-fast: false
matrix:
build_type: [with-srp, without-srp]

steps:
- name: Checkout repo
uses: actions/checkout@v4

- name: Setup Android Build Environment
uses: MetaMask/github-tools/.github/actions/setup-e2e-env@self-hosted-runners-config
with:
platform: android
setup-simulator: false
configure-keystores: true
target: qa

- name: Cache Gradle dependencies
uses: actions/cache@v4
with:
path: |
/home/runner/_work/.gradle/caches
/home/runner/_work/.gradle/wrapper
android/.gradle
key: gradle-${{ runner.os }}-${{ matrix.build_type }}-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
gradle-${{ runner.os }}-${{ matrix.build_type }}-
gradle-${{ runner.os }}-

- name: Build Android E2E APK - ${{ matrix.build_type }}
run: |
echo "🚀 Setting up project for ${{ matrix.build_type }} build..."
yarn setup:github-ci --no-build-ios

echo "🏗 Building Android E2E APK (${{ matrix.build_type }})..."
export NODE_OPTIONS="--max-old-space-size=8192"
# Use dedicated dual versions properties file for ARM architectures
cp android/gradle.properties.github.dual-versions android/gradle.properties
yarn build:android:main:e2e
shell: bash
env:
PLATFORM: android
METAMASK_ENVIRONMENT: qa
METAMASK_BUILD_TYPE: main
IS_TEST: false
E2E: "true"
IGNORE_BOXLOGS_DEVELOPMENT: true
GITHUB_CI: "true"
CI: "true"
NODE_OPTIONS: "--max-old-space-size=8192"
MM_UNIFIED_SWAPS_ENABLED: "true"
MM_BRIDGE_ENABLED: "true"
BRIDGE_USE_DEV_APIS: "true"
RAMP_INTERNAL_BUILD: "true"
SEEDLESS_ONBOARDING_ENABLED: "true"
MM_NOTIFICATIONS_UI_ENABLED: "true"
DISABLE_NOTIFICATION_PROMPT: "true"
MM_SECURITY_ALERTS_API_ENABLED: "true"
MM_REMOVE_GLOBAL_NETWORK_SELECTOR: "true"
# Conditionally set SRP and password based on build type
ADDITIONAL_SRP_1: ${{ matrix.build_type == 'with-srp' && secrets.TEST_SRP_1 || '' }}
PREDEFINED_PASSWORD: ${{ matrix.build_type == 'with-srp' && secrets.E2E_PASSWORD || '' }}
FEATURES_ANNOUNCEMENTS_ACCESS_TOKEN: ${{ secrets.FEATURES_ANNOUNCEMENTS_ACCESS_TOKEN }}
FEATURES_ANNOUNCEMENTS_SPACE_ID: ${{ secrets.FEATURES_ANNOUNCEMENTS_SPACE_ID }}
SEGMENT_WRITE_KEY_QA: ${{ secrets.SEGMENT_WRITE_KEY_QA }}
SEGMENT_PROXY_URL_QA: ${{ secrets.SEGMENT_PROXY_URL_QA }}
SEGMENT_DELETE_API_SOURCE_ID_QA: ${{ secrets.SEGMENT_DELETE_API_SOURCE_ID_QA }}
SEGMENT_REGULATIONS_ENDPOINT_QA: ${{ secrets.SEGMENT_REGULATIONS_ENDPOINT_QA }}
MM_SENTRY_DSN_TEST: ${{ secrets.MM_SENTRY_DSN_TEST }}
MM_SENTRY_AUTH_TOKEN: ${{ secrets.MM_SENTRY_AUTH_TOKEN }}
MAIN_IOS_GOOGLE_CLIENT_ID_UAT: ${{ secrets.MAIN_IOS_GOOGLE_CLIENT_ID_UAT }}
MAIN_IOS_GOOGLE_REDIRECT_URI_UAT: ${{ secrets.MAIN_IOS_GOOGLE_REDIRECT_URI_UAT }}
MAIN_ANDROID_APPLE_CLIENT_ID_UAT: ${{ secrets.MAIN_ANDROID_APPLE_CLIENT_ID_UAT }}
MAIN_ANDROID_GOOGLE_CLIENT_ID_UAT: ${{ secrets.MAIN_ANDROID_GOOGLE_CLIENT_ID_UAT }}
MAIN_ANDROID_GOOGLE_SERVER_CLIENT_ID_UAT: ${{ secrets.MAIN_ANDROID_GOOGLE_SERVER_CLIENT_ID_UAT }}
GOOGLE_SERVICES_B64_IOS: ${{ secrets.GOOGLE_SERVICES_B64_IOS }}
GOOGLE_SERVICES_B64_ANDROID: ${{ secrets.GOOGLE_SERVICES_B64_ANDROID }}
MM_INFURA_PROJECT_ID: ${{ secrets.MM_INFURA_PROJECT_ID }}

- name: Upload Android APK - ${{ matrix.build_type }}
id: upload-apk
uses: actions/upload-artifact@v4
with:
name: app-prod-release-${{ matrix.build_type }}.apk
path: android/app/build/outputs/apk/prod/release/app-prod-release.apk
retention-days: 7
if-no-files-found: error

# Job to upload APKs to BrowserStack and get URLs
upload-to-browserstack:
name: Upload to BrowserStack and Get URLs
runs-on: ubuntu-latest
needs: build-android-dual
if: always() && (needs.build-android-dual.result == 'success' || needs.build-android-dual.result == 'partial_success')
outputs:
with-srp-browserstack-url: ${{ steps.browserstack-upload.outputs.with-srp-browserstack-url }}
without-srp-browserstack-url: ${{ steps.browserstack-upload.outputs.without-srp-browserstack-url }}
with-srp-app-id: ${{ steps.browserstack-upload.outputs.with-srp-app-id }}
without-srp-app-id: ${{ steps.browserstack-upload.outputs.without-srp-app-id }}
with-srp-version: ${{ steps.browserstack-upload.outputs.with-srp-version }}
without-srp-version: ${{ steps.browserstack-upload.outputs.without-srp-version }}

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Download APK Artifacts
uses: actions/download-artifact@v4
with:
path: ./artifacts
continue-on-error: true

- name: BrowserStack Env Setup
uses: browserstack/github-actions/setup-env@4478e16186f38e5be07721931642e65a028713c3
with:
username: ${{ env.BROWSERSTACK_USERNAME }}
access-key: ${{ env.BROWSERSTACK_ACCESS_KEY }}
project-name: ${{ github.repository }}

- name: Upload APKs to BrowserStack
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because the tests are running on a browserstack device, i need to upload the builds to BrowserStack and get the associated bs url to trigger the performance test

id: browserstack-upload
run: |
echo "Uploading APKs to BrowserStack..."

# List artifacts directory structure for debugging
echo "Artifacts directory structure:"
find ./artifacts -type f -name "*.apk" | head -10
echo "Full artifacts directory tree:"
find ./artifacts -type d | head -20

# Find the APK files in their subdirectories
WITH_SRP_APK=$(find ./artifacts -path "*/app-prod-release-with-srp.apk/app-prod-release.apk" | head -1)
WITHOUT_SRP_APK=$(find ./artifacts -path "*/app-prod-release-without-srp.apk/app-prod-release.apk" | head -1)

# Fallback: if not found in subdirectories, try direct search
if [ -z "$WITH_SRP_APK" ]; then
echo "With-SRP APK not found in subdirectory, trying direct search..."
WITH_SRP_APK=$(find ./artifacts -name "app-prod-release-with-srp.apk" | head -1)
fi

if [ -z "$WITHOUT_SRP_APK" ]; then
echo "Without-SRP APK not found in subdirectory, trying direct search..."
WITHOUT_SRP_APK=$(find ./artifacts -name "app-prod-release-without-srp.apk" | head -1)
fi

echo "Found APKs:"
echo " With SRP: $WITH_SRP_APK"
echo " Without SRP: $WITHOUT_SRP_APK"

# Verify files exist and are readable
if [ -n "$WITH_SRP_APK" ] && [ -f "$WITH_SRP_APK" ]; then
echo "With-SRP APK file exists and is readable"
ls -la "$WITH_SRP_APK"
else
echo "With-SRP APK file not found or not readable"
fi

if [ -n "$WITHOUT_SRP_APK" ] && [ -f "$WITHOUT_SRP_APK" ]; then
echo "Without-SRP APK file exists and is readable"
ls -la "$WITHOUT_SRP_APK"
else
echo "Without-SRP APK file not found or not readable"
fi

# Upload with-SRP APK
if [ -f "$WITH_SRP_APK" ]; then
echo "Uploading with-SRP APK to BrowserStack..."
WITH_SRP_RESPONSE=$(curl -u "$BROWSERSTACK_USERNAME:$BROWSERSTACK_ACCESS_KEY" \
-X POST "https://api-cloud.browserstack.com/app-automate/upload" \
-F "file=@$WITH_SRP_APK" \
-F "custom_id=MetaMask-Android-With-SRP-${{ github.run_id }}")

WITH_SRP_APP_URL=$(echo "$WITH_SRP_RESPONSE" | jq -r '.app_url')
WITH_SRP_APP_ID=$(echo "$WITH_SRP_RESPONSE" | jq -r '.app_id')

echo "With-SRP APK uploaded successfully"
echo " App URL: $WITH_SRP_APP_URL"
echo " App ID: $WITH_SRP_APP_ID"

{
echo "with-srp-browserstack-url=$WITH_SRP_APP_URL"
echo "with-srp-app-id=$WITH_SRP_APP_ID"
echo "with-srp-version=Manual-Input"
} >> "$GITHUB_OUTPUT"
else
echo "With-SRP APK not found"
{
echo "with-srp-browserstack-url="
echo "with-srp-app-id="
echo "with-srp-version="
} >> "$GITHUB_OUTPUT"
fi

# Upload without-SRP APK
if [ -f "$WITHOUT_SRP_APK" ]; then
echo "Uploading without-SRP APK to BrowserStack..."
WITHOUT_SRP_RESPONSE=$(curl -u "$BROWSERSTACK_USERNAME:$BROWSERSTACK_ACCESS_KEY" \
-X POST "https://api-cloud.browserstack.com/app-automate/upload" \
-F "file=@$WITHOUT_SRP_APK" \
-F "custom_id=MetaMask-Android-Without-SRP-${{ github.run_id }}")

WITHOUT_SRP_APP_URL=$(echo "$WITHOUT_SRP_RESPONSE" | jq -r '.app_url')
WITHOUT_SRP_APP_ID=$(echo "$WITHOUT_SRP_RESPONSE" | jq -r '.app_id')

echo "Without-SRP APK uploaded successfully"
echo "App URL: $WITHOUT_SRP_APP_URL"
echo "App ID: $WITHOUT_SRP_APP_ID"

{
echo "without-srp-browserstack-url=$WITHOUT_SRP_APP_URL"
echo "without-srp-app-id=$WITHOUT_SRP_APP_ID"
echo "without-srp-version=Manual-Input"
} >> "$GITHUB_OUTPUT"
else
echo "Without-SRP APK not found"
{
echo "without-srp-browserstack-url="
echo "without-srp-app-id="
echo "without-srp-version="
} >> "$GITHUB_OUTPUT"
fi

echo "BrowserStack upload process completed!"
echo "With-SRP URL: $WITH_SRP_APP_URL"
echo "Without-SRP URL: $WITHOUT_SRP_APP_URL"
Loading
Loading