diff --git a/tests/performance/README.md b/tests/performance/README.md index 2c9d1554b36..f0e4bb7b27e 100644 --- a/tests/performance/README.md +++ b/tests/performance/README.md @@ -292,8 +292,8 @@ Integration tests for MetaMask Connect: - `legacy-evm-rn-connect.spec.ts` - Legacy EVM connection via the React Native Playground APK > The RN playground tests require a separate APK built from the -> [`playground/react-native-playground`](https://github.com/MetaMask/connect-monorepo/tree/main/playground/react-native-playground) -> directory of the [connect-monorepo](https://github.com/MetaMask/connect-monorepo). +> [`playground/react-native-playground`](https://github.com/MetaMask/metamask-connect/tree/main/playground/react-native-playground) +> directory of the [metamask-connect](https://github.com/MetaMask/metamask-connect). > The APK must be installed on the emulator before running. > See [`tests/performance/mm-connect/README.md`](mm-connect/README.md) for full setup instructions. diff --git a/tests/performance/mm-connect/README.md b/tests/performance/mm-connect/README.md index d49d13fde0a..b18d5361db2 100644 --- a/tests/performance/mm-connect/README.md +++ b/tests/performance/mm-connect/README.md @@ -26,14 +26,14 @@ automatically **uninstalls and reinstalls** it on the emulator every run. | --------------------------- | ------------------------------------------------------------- | | Android emulator | Running and reachable via `adb` | | MetaMask wallet APK | Built or pointed to via `buildPath` in `playwright.config.ts` | -| `connect-monorepo` checkout | Cloned **next to** `metamask-mobile` (same parent directory) | +| `metamask-connect` checkout | Cloned **next to** `metamask-mobile` (same parent directory) | Expected directory layout: ``` Documents/MetaMask/ # or wherever you keep these repos ├── metamask-mobile/ # this repo -└── connect-monorepo/ # https://github.com/MetaMask/connect-monorepo +└── metamask-connect/ # https://github.com/MetaMask/metamask-connect └── playground/ └── react-native-playground/ ``` @@ -41,7 +41,7 @@ Documents/MetaMask/ # or wherever you keep these repos ### Get the Playground APK The playground APK is published as a GitHub Release asset with every -connect-monorepo release. You can download it automatically or build locally. +metamask-connect release. You can download it automatically or build locally. #### Option A — Download from GitHub Releases (recommended) @@ -81,7 +81,7 @@ expects a Metro dev server at runtime. **Step 1 — Install monorepo dependencies:** ```bash -cd /path/to/connect-monorepo +cd /path/to/metamask-connect yarn install ``` @@ -89,7 +89,7 @@ yarn install `@metamask/playground-ui`, etc. have their `dist/` output): ```bash -cd /path/to/connect-monorepo +cd /path/to/metamask-connect yarn build ``` @@ -99,7 +99,7 @@ The playground uses Infura RPC endpoints for blockchain requests. Copy the example `.env` file and add your key: ```bash -cd /path/to/connect-monorepo/playground/react-native-playground +cd /path/to/metamask-connect/playground/react-native-playground cp .env.example .env ``` @@ -116,14 +116,14 @@ EXPO_PUBLIC_INFURA_API_KEY=your_infura_api_key_here deleting the `android/` directory): ```bash -cd /path/to/connect-monorepo/playground/react-native-playground +cd /path/to/metamask-connect/playground/react-native-playground npx expo prebuild --platform android ``` **Step 5 — Build the release APK:** ```bash -cd /path/to/connect-monorepo/playground/react-native-playground/android +cd /path/to/metamask-connect/playground/react-native-playground/android ./gradlew assembleRelease ``` @@ -131,7 +131,7 @@ The first build takes ~7 minutes. Subsequent builds are incremental and much faster. The output APK will be at: ``` -connect-monorepo/playground/react-native-playground/android/app/build/outputs/apk/release/app-release.apk +metamask-connect/playground/react-native-playground/android/app/build/outputs/apk/release/app-release.apk ``` #### Rebuilding after changes @@ -139,7 +139,7 @@ connect-monorepo/playground/react-native-playground/android/app/build/outputs/ap When you edit the playground source, run the build command again: ```bash -cd /path/to/connect-monorepo/playground/react-native-playground/android +cd /path/to/metamask-connect/playground/react-native-playground/android ./gradlew assembleRelease ``` @@ -147,7 +147,7 @@ If you also changed shared workspace packages (e.g. `@metamask/playground-ui`), rebuild those first: ```bash -cd /path/to/connect-monorepo +cd /path/to/metamask-connect yarn build ``` @@ -160,7 +160,7 @@ BrowserStack before test execution. The relevant environment variables are: | Variable | Description | | -------------------------------- | ----------------------------------------------- | -| `RN_PLAYGROUND_APK_VERSION` | Pin to a specific connect-monorepo release | +| `RN_PLAYGROUND_APK_VERSION` | Pin to a specific metamask-connect release | | `RN_PLAYGROUND_APK_PATH` | Override APK path (skips download) | | `BROWSERSTACK_RN_PLAYGROUND_URL` | BrowserStack `bs://` URL for the playground APK | @@ -289,12 +289,12 @@ reinstall (`adb install app/build/outputs/apk/release/app-release.apk`). **`RPCErr50: 401 on https://mainnet.infura.io/v3/ for method POST`** The Infura API key is missing or was not inlined during the APK build. Make -sure the `.env` file in `connect-monorepo/playground/react-native-playground/` +sure the `.env` file in `metamask-connect/playground/react-native-playground/` contains a valid `EXPO_PUBLIC_INFURA_API_KEY`. After updating the key you must clear the build cache and rebuild: ```bash -cd /path/to/connect-monorepo/playground/react-native-playground +cd /path/to/metamask-connect/playground/react-native-playground rm -rf android/app/build cd android && ./gradlew assembleRelease ``` diff --git a/tests/performance/mm-connect/utils.ts b/tests/performance/mm-connect/utils.ts index 10ae50d69fd..e5793fdeebf 100644 --- a/tests/performance/mm-connect/utils.ts +++ b/tests/performance/mm-connect/utils.ts @@ -117,11 +117,11 @@ export function cleanupAdbReverse(port: number): void { // Candidate paths for the playground release APK, checked in priority order: // 1. Explicitly set via RN_PLAYGROUND_APK_PATH env var // 2. Downloaded by tests/scripts/fetch-rn-playground-apk.sh -// 3. Locally built in sibling connect-monorepo +// 3. Locally built in sibling metamask-connect const PLAYGROUND_APK_CANDIDATES = [ process.env.RN_PLAYGROUND_APK_PATH, './tmp/rn-playground.apk', - '../connect-monorepo/playground/react-native-playground/android/app/build/outputs/apk/release/app-release.apk', + '../metamask-connect/playground/react-native-playground/android/app/build/outputs/apk/release/app-release.apk', ].filter(Boolean) as string[]; /** @@ -142,9 +142,9 @@ function resolvePlaygroundApkPath(): string { ).join('\n') + '\n\nTo fix this, either:\n' + ' 1. Run: ./tests/scripts/fetch-rn-playground-apk.sh\n' + - ' (downloads the latest APK from connect-monorepo GitHub Releases)\n' + + ' (downloads the latest APK from metamask-connect GitHub Releases)\n' + ' 2. Build locally:\n' + - ' cd connect-monorepo && yarn install && yarn build\n' + + ' cd metamask-connect && yarn install && yarn build\n' + ' cd playground/react-native-playground && npx expo prebuild --platform android\n' + ' cd android && ./gradlew assembleRelease\n' + ' 3. Set RN_PLAYGROUND_APK_PATH to the APK location\n\n' + diff --git a/tests/scripts/fetch-rn-playground-apk.sh b/tests/scripts/fetch-rn-playground-apk.sh index 2f021797180..4a4d274a2b5 100755 --- a/tests/scripts/fetch-rn-playground-apk.sh +++ b/tests/scripts/fetch-rn-playground-apk.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -# Fetch the React Native Playground APK from the connect-monorepo GitHub Releases. +# Fetch the React Native Playground APK from the metamask-connect GitHub Releases. # # Usage: # ./tests/scripts/fetch-rn-playground-apk.sh [--version ] [--output ] @@ -15,11 +15,11 @@ # RN_PLAYGROUND_APK_VERSION Alternative to --version flag. # # The script downloads the rn-playground-.apk asset from the -# MetaMask/connect-monorepo GitHub Release matching the requested version. +# MetaMask/metamask-connect GitHub Release matching the requested version. set -euo pipefail -REPO="MetaMask/connect-monorepo" +REPO="MetaMask/metamask-connect" APK_PATTERN="rn-playground-" OUTPUT_PATH="./tmp/rn-playground.apk" VERSION="${RN_PLAYGROUND_APK_VERSION:-}"