Commit ef81f2d
authored
test: fixed experimental build workflow (#26633)
<!--
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**
## Summary
The **Performance E2E Tests for Experimental Builds** workflow was
failing because the Android APK artifact matching was hardcoded to look
for `metamask-main-rc-*.apk`, which doesn't match experimental builds
that produce `metamask-main-exp-*.apk`. This caused the BrowserStack URL
to be empty, making all downstream Android test jobs fail with `"No
android BrowserStack URL available"`.
## Root Cause
Two issues in the CI workflow:
1. **Hardcoded APK name pattern**
(`build-android-upload-to-browserstack.yml`): The jq filter used
`metamask-main-rc-[0-9]+\.apk` to locate the APK artifact from Bitrise.
When the experimental workflow passes `build_variant: exp`, Bitrise runs
`build_android_main_exp` which produces APKs named
`metamask-main-exp-*.apk` — the regex never matched them.
2. **Weak `if` conditions** (`run-performance-e2e.yml`): Test jobs used
`needs.trigger-android-dual-versions.result == 'success'` to decide
whether to run, but this evaluates to `true` even when the build job
"succeeded" without actually producing a BrowserStack URL (e.g., when
the artifact wasn't found but the step didn't exit with an error).
## Changes
### `build-android-upload-to-browserstack.yml`
- Made the APK name regex dynamic using `inputs.build_variant` (defaults
to `rc`), so it matches `metamask-main-rc-*.apk` for release builds and
`metamask-main-exp-*.apk` for experimental builds.
- Added `exit 1` when APK artifact is not found or build ID is
unavailable (previously these were silent warnings).
- Added debug logging to print the APK pattern being searched for.
### `run-performance-e2e.yml`
- Replaced loose `if` conditions with explicit checks that the actual
BrowserStack URL output is non-empty (e.g.,
`needs.trigger-android-dual-versions.outputs.without-srp-browserstack-url
!= ''`).
- Added `!cancelled()` guard to imported-wallet and mm-connect test jobs
for consistency.
## Note
The iOS workflow (`build-ios-upload-to-browserstack.yml`) was **not
affected** — its regex `metamask-device-main-[a-zA-Z0-9-]+-[0-9]+\.ipa`
already accommodates any variant.
<!--
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]
> **Medium Risk**
> Workflow logic changes can alter when performance jobs run and when
the BrowserStack upload step fails, potentially causing unexpected CI
skips or failures. Scope is limited to GitHub Actions/Bitrise artifact
handling, not app runtime code.
>
> **Overview**
> Fixes Android BrowserStack uploads for experimental builds by making
the Bitrise artifact match pattern depend on `inputs.build_variant`
(e.g., `metamask-main-exp-*` vs `metamask-main-rc-*`), and improves
error handling so the step records per-APK failures and only fails if
*both* uploads fail.
>
> Tightens `run-performance-e2e.yml` job `if` conditions to gate
onboarding/imported-wallet/mm-connect runs on *non-empty* BrowserStack
URL outputs (or explicitly provided inputs), and adds `!cancelled()`
guards for consistency.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
af1ab7f. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->1 parent 6822001 commit ef81f2d
2 files changed
Lines changed: 179 additions & 156 deletions
0 commit comments