From 49e87a2ecf1f165b961bfff8fc9a23bcad733edb Mon Sep 17 00:00:00 2001 From: siepra Date: Wed, 4 Oct 2023 13:53:52 +0200 Subject: [PATCH 1/6] Prevent running desktop e2e tests on wrong tag --- .github/workflows/desktop-build.yml | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/.github/workflows/desktop-build.yml b/.github/workflows/desktop-build.yml index 05b09d4311..2c2f4a498c 100644 --- a/.github/workflows/desktop-build.yml +++ b/.github/workflows/desktop-build.yml @@ -4,6 +4,8 @@ on: release: types: [released, prereleased] + if: | + startsWith(github.ref, 'refs/tags/@quiet/desktop') jobs: run-e2e-tests-linux: @@ -16,8 +18,6 @@ jobs: build-linux: # needs: run-e2e-tests-linux runs-on: ubuntu-22.04 - if: | - startsWith(github.ref, 'refs/tags/@quiet/desktop') env: TEST_MODE: ${{ github.event.action == 'prereleased' }} @@ -88,8 +88,6 @@ jobs: build-macos: # needs: run-e2e-tests-mac runs-on: macos-latest - if: | - startsWith(github.ref, 'refs/tags/@quiet/desktop') env: TEST_MODE: ${{ github.event.action == 'prereleased' }} @@ -161,8 +159,6 @@ jobs: build-windows: # needs: run-e2e-tests-win runs-on: windows-2019 - if: | - startsWith(github.ref, 'refs/tags/@quiet/desktop') env: TEST_MODE: ${{ github.event.action == 'prereleased' }} From fe3e6d3d1c2963539cefd7a9b08f920f181aa0de Mon Sep 17 00:00:00 2001 From: siepra Date: Thu, 5 Oct 2023 14:44:32 +0200 Subject: [PATCH 2/6] Add debug logs for deep link issue --- packages/mobile/src/App.tsx | 2 ++ .../mobile/src/store/navigation/redirection/redirection.saga.ts | 2 ++ packages/mobile/src/store/store.ts | 1 + 3 files changed, 5 insertions(+) diff --git a/packages/mobile/src/App.tsx b/packages/mobile/src/App.tsx index c8d477d2e5..abbe0d9e62 100644 --- a/packages/mobile/src/App.tsx +++ b/packages/mobile/src/App.tsx @@ -75,6 +75,8 @@ function App(): JSX.Element { linking={linking} onReady={() => { dispatch(initActions.blindWebsocketConnection()) + + console.log('dispatch redirection action') dispatch(navigationActions.redirection()) }} > diff --git a/packages/mobile/src/store/navigation/redirection/redirection.saga.ts b/packages/mobile/src/store/navigation/redirection/redirection.saga.ts index a2f60b5519..9d30e5a26e 100644 --- a/packages/mobile/src/store/navigation/redirection/redirection.saga.ts +++ b/packages/mobile/src/store/navigation/redirection/redirection.saga.ts @@ -7,6 +7,8 @@ import { identity } from '@quiet/state-manager' import { initActions } from '../../init/init.slice' export function* redirectionSaga(): Generator { + console.log('entered redirection saga') + // Do not redirect if user opened the app from url (quiet://) const deepLinking = yield* select(initSelectors.deepLinking) if (deepLinking) return diff --git a/packages/mobile/src/store/store.ts b/packages/mobile/src/store/store.ts index 35a0ea0dcc..67811942f8 100644 --- a/packages/mobile/src/store/store.ts +++ b/packages/mobile/src/store/store.ts @@ -58,5 +58,6 @@ export const store = configureStore({ }) export const persistor = persistStore(store, {}, () => { + console.log('store ready') store.dispatch(initActions.setStoreReady()) }) From 116c9252146cf8da0769f14a37c7ced02ecc5076 Mon Sep 17 00:00:00 2001 From: siepra Date: Thu, 5 Oct 2023 14:44:56 +0200 Subject: [PATCH 3/6] Publish - @quiet/mobile@2.0.0-alpha.20 --- packages/mobile/CHANGELOG.md | 8 ++++++++ packages/mobile/android/app/build.gradle | 4 ++-- packages/mobile/ios/Quiet/Info.plist | 2 +- packages/mobile/ios/QuietTests/Info.plist | 2 +- packages/mobile/package-lock.json | 4 ++-- packages/mobile/package.json | 2 +- 6 files changed, 15 insertions(+), 7 deletions(-) diff --git a/packages/mobile/CHANGELOG.md b/packages/mobile/CHANGELOG.md index 24a3d9d80b..1668315525 100644 --- a/packages/mobile/CHANGELOG.md +++ b/packages/mobile/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [2.0.0-alpha.20](https://github.com/ZbayApp/monorepo/compare/@quiet/mobile@2.0.0-alpha.19...@quiet/mobile@2.0.0-alpha.20) (2023-10-05) + +**Note:** Version bump only for package @quiet/mobile + + + + + # [2.0.0-alpha.19](https://github.com/ZbayApp/monorepo/compare/@quiet/mobile@2.0.0-alpha.18...@quiet/mobile@2.0.0-alpha.19) (2023-10-04) **Note:** Version bump only for package @quiet/mobile diff --git a/packages/mobile/android/app/build.gradle b/packages/mobile/android/app/build.gradle index 01cd4ec4b4..8ddd35623a 100644 --- a/packages/mobile/android/app/build.gradle +++ b/packages/mobile/android/app/build.gradle @@ -166,8 +166,8 @@ android { applicationId "com.quietmobile" minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion - versionCode 337 - versionName "2.0.0-alpha.19" + versionCode 338 + versionName "2.0.0-alpha.20" resValue "string", "build_config_package", "com.quietmobile" testBuildType System.getProperty('testBuildType', 'debug') testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner' diff --git a/packages/mobile/ios/Quiet/Info.plist b/packages/mobile/ios/Quiet/Info.plist index 6d98b149e8..82d1e437b4 100644 --- a/packages/mobile/ios/Quiet/Info.plist +++ b/packages/mobile/ios/Quiet/Info.plist @@ -34,7 +34,7 @@ CFBundleVersion - 317 + 318 ITSAppUsesNonExemptEncryption LSRequiresIPhoneOS diff --git a/packages/mobile/ios/QuietTests/Info.plist b/packages/mobile/ios/QuietTests/Info.plist index 3a4703b7fc..adaf5ba469 100644 --- a/packages/mobile/ios/QuietTests/Info.plist +++ b/packages/mobile/ios/QuietTests/Info.plist @@ -19,6 +19,6 @@ CFBundleSignature ???? CFBundleVersion - 317 + 318 diff --git a/packages/mobile/package-lock.json b/packages/mobile/package-lock.json index fe37114f50..c9b929b00f 100644 --- a/packages/mobile/package-lock.json +++ b/packages/mobile/package-lock.json @@ -1,12 +1,12 @@ { "name": "@quiet/mobile", - "version": "2.0.0-alpha.19", + "version": "2.0.0-alpha.20", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@quiet/mobile", - "version": "2.0.0-alpha.19", + "version": "2.0.0-alpha.20", "dependencies": { "@peculiar/webcrypto": "^1.4.3", "@react-native-clipboard/clipboard": "^1.11.2", diff --git a/packages/mobile/package.json b/packages/mobile/package.json index c72c43b7c6..357a1d4172 100644 --- a/packages/mobile/package.json +++ b/packages/mobile/package.json @@ -1,6 +1,6 @@ { "name": "@quiet/mobile", - "version": "2.0.0-alpha.19", + "version": "2.0.0-alpha.20", "scripts": { "build": "tsc -p tsconfig.build.json --noEmit", "storybook-android": "ENVFILE=.env.storybook react-native run-android --variant=storybookDebug --appIdSuffix=storybook.debug", From a14fafb0bc92a32b135e7827512861e399c55b91 Mon Sep 17 00:00:00 2001 From: siepra Date: Thu, 5 Oct 2023 14:49:39 +0200 Subject: [PATCH 4/6] Revert "Prevent running desktop e2e tests on wrong tag" This reverts commit 49e87a2ecf1f165b961bfff8fc9a23bcad733edb. --- .github/workflows/desktop-build.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/desktop-build.yml b/.github/workflows/desktop-build.yml index 2c2f4a498c..05b09d4311 100644 --- a/.github/workflows/desktop-build.yml +++ b/.github/workflows/desktop-build.yml @@ -4,8 +4,6 @@ on: release: types: [released, prereleased] - if: | - startsWith(github.ref, 'refs/tags/@quiet/desktop') jobs: run-e2e-tests-linux: @@ -18,6 +16,8 @@ jobs: build-linux: # needs: run-e2e-tests-linux runs-on: ubuntu-22.04 + if: | + startsWith(github.ref, 'refs/tags/@quiet/desktop') env: TEST_MODE: ${{ github.event.action == 'prereleased' }} @@ -88,6 +88,8 @@ jobs: build-macos: # needs: run-e2e-tests-mac runs-on: macos-latest + if: | + startsWith(github.ref, 'refs/tags/@quiet/desktop') env: TEST_MODE: ${{ github.event.action == 'prereleased' }} @@ -159,6 +161,8 @@ jobs: build-windows: # needs: run-e2e-tests-win runs-on: windows-2019 + if: | + startsWith(github.ref, 'refs/tags/@quiet/desktop') env: TEST_MODE: ${{ github.event.action == 'prereleased' }} From ad96d8cdefd0bd198ae15d789e460916f9004817 Mon Sep 17 00:00:00 2001 From: siepra Date: Mon, 9 Oct 2023 10:32:11 +0200 Subject: [PATCH 5/6] Prevent running desktop e2e tests on wrong tag --- .github/workflows/desktop-build.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/desktop-build.yml b/.github/workflows/desktop-build.yml index 05b09d4311..c3e0fcf512 100644 --- a/.github/workflows/desktop-build.yml +++ b/.github/workflows/desktop-build.yml @@ -6,11 +6,20 @@ on: [released, prereleased] jobs: + run-e2e-tests-linux: + if: | + startsWith(github.ref, 'refs/tags/@quiet/desktop') uses: ./.github/workflows/e2e-linux.yml + run-e2e-tests-mac: + if: | + startsWith(github.ref, 'refs/tags/@quiet/desktop') uses: ./.github/workflows/e2e-mac.yml + run-e2e-tests-win: + if: | + startsWith(github.ref, 'refs/tags/@quiet/desktop') uses: ./.github/workflows/e2e-win.yml build-linux: From 94855a8405496122b21007599b249a66763e9cb2 Mon Sep 17 00:00:00 2001 From: Wiktor Sieprawski Date: Mon, 9 Oct 2023 10:37:22 +0200 Subject: [PATCH 6/6] Ci/use self hosted runner (#1931) * Add e2e iOS workflow * Dummy mobile change * Navigate to project's directory * Intentionally break the test * Use checkout and setup project * Use project directory * Don't reuse setup environment step * Correct step * Print location * Skip path * Install dependencies * Add more steps * Point to mobile dir * Dummy change * Git lfs * Fix test * Add Detox CI config * Decrease timeout * Use more labels for runner --- .github/workflows/e2e-ios.yml | 39 +++++++++++++++++++++++++++++++++++ packages/mobile/.detoxrc.js | 16 ++++++++++++++ 2 files changed, 55 insertions(+) create mode 100644 .github/workflows/e2e-ios.yml diff --git a/.github/workflows/e2e-ios.yml b/.github/workflows/e2e-ios.yml new file mode 100644 index 0000000000..91c81888e1 --- /dev/null +++ b/.github/workflows/e2e-ios.yml @@ -0,0 +1,39 @@ +name: E2E iOS + +on: + pull_request: + paths: + - packages/mobile/** + +jobs: + detox: + timeout-minutes: 10 + runs-on: [self-hosted, macOS, ARM64] + + steps: + - uses: actions/checkout@v4 + + - name: Install dependencies + run: | + npm i + npm run lerna bootstrap --scope @quiet/eslint-config,@quiet/logger,@quiet/common,@quiet/types,@quiet/state-manager,@quiet/backend,@quiet/identity,@quiet/mobile,backend-bundle + + - name: Pull binaries + run: | + git lfs install + git lfs pull + + - name: Install pods + run: | + cd packages/mobile/ios + pod install + + - name: Build Detox + run: | + cd packages/mobile + detox build -c ios.sim.debug.ci + + - name: Run basic tests + run: | + cd packages/mobile + detox test starter -c ios.sim.debug.ci diff --git a/packages/mobile/.detoxrc.js b/packages/mobile/.detoxrc.js index fd27530ff9..dcd88f0d4b 100644 --- a/packages/mobile/.detoxrc.js +++ b/packages/mobile/.detoxrc.js @@ -56,6 +56,12 @@ module.exports = { type: 'iPhone 14', }, }, + simulator_ci: { + type: 'ios.simulator', + device: { + type: 'iPhone 15' + } + }, attached: { type: 'android.attached', device: { @@ -80,6 +86,16 @@ module.exports = { }, }, }, + 'ios.sim.debug.ci': { + device: 'simulator_ci', + app: 'ios.debug', + artifacts: { + rootDir: './e2e/artifacts/ios', + plugins: { + instruments: 'all', + }, + }, + }, 'ios.sim.storybook': { device: 'simulator', app: 'ios.storybook',