Skip to content

Commit c2dba47

Browse files
committed
Merge branch 'develop' into chore/2312
2 parents 6655c22 + b8ef745 commit c2dba47

File tree

17 files changed

+206
-69
lines changed

17 files changed

+206
-69
lines changed
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Detox E2E Android (self-hosted)
2+
3+
on:
4+
push:
5+
paths:
6+
- packages/mobile/**
7+
- packages/backend/**
8+
- packages/state-manager/**
9+
- .github/workflows/e2e-android-self.yml
10+
11+
jobs:
12+
detox-android-self-hosted:
13+
timeout-minutes: 10
14+
runs-on: [self-hosted, macOS, ARM64, android]
15+
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- name: Install dependencies
20+
run: |
21+
npm i
22+
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
23+
24+
- name: Pull binaries
25+
run: |
26+
git lfs install --force
27+
git lfs pull
28+
29+
- name: Pass local config
30+
run : |
31+
cat << EOF >> packages/mobile/android/local.properties
32+
ndk.path=/Users/quiet/Library/Android/sdk/ndk/25.1.8937393
33+
EOF
34+
35+
- name: Build Detox
36+
run: |
37+
export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home
38+
cd packages/mobile
39+
detox build -c android.emu.debug.ci
40+
41+
- name: Run basic tests
42+
run: |
43+
cd packages/mobile
44+
detox test starter -c android.emu.debug.ci

.github/workflows/e2e-android.yml

Lines changed: 63 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,88 @@
1-
name: E2E Android
1+
name: Detox E2E Android
22

3-
on:
4-
push:
5-
paths:
6-
- packages/mobile/**
7-
- packages/backend/**
8-
- packages/state-manager/**
9-
- .github/workflows/e2e-android.yml
3+
on: workflow_dispatch
104

115
jobs:
126
detox-android:
13-
timeout-minutes: 10
14-
runs-on: [self-hosted, macOS, ARM64, android]
7+
timeout-minutes: 25
8+
runs-on: [macos-latest-xlarge]
159

1610
steps:
1711
- uses: actions/checkout@v4
12+
13+
- uses: actions/setup-node@master
14+
with:
15+
node-version: 18.12.1
1816

1917
- name: Install dependencies
2018
run: |
21-
npm i
22-
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
19+
npm ci
20+
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}\'
2321
2422
- name: Pull binaries
2523
run: |
26-
git lfs install
24+
git lfs install --force
2725
git lfs pull
2826
29-
- name: Pass local config
30-
run : |
31-
cat << EOF >> packages/mobile/android/local.properties
32-
ndk.path=/Users/quiet/Library/Android/sdk/ndk/25.1.8937393
33-
EOF
27+
# see: https://stackoverflow.com/questions/67264212/android-emulator-crash-when-start-hvf-error-hv-error
28+
- name: Create qemu entitlements
29+
run: |
30+
{
31+
echo '<?xml version="1.0" encoding="UTF-8"?>'
32+
echo '<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">'
33+
echo '<plist version="1.0">'
34+
echo '<dict>'
35+
echo ' <key>com.apple.security.hypervisor</key>'
36+
echo ' <true/>'
37+
echo '</dict>'
38+
echo '</plist>'
39+
} >> $ANDROID_HOME/emulator/qemu/darwin-aarch64/entitlements.xml
40+
41+
- name: Re-sign qemu binary
42+
run: |
43+
cd $ANDROID_HOME/emulator/qemu/darwin-aarch64
44+
codesign -s - --entitlements entitlements.xml --force qemu-system-aarch64 --verbose
45+
46+
- name: Install SDK image
47+
run: yes | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --install 'system-images;android-34;google_apis;arm64-v8a'
48+
49+
- name: Create AVD
50+
run: $ANDROID_HOME/cmdline-tools/latest/bin/avdmanager create avd -n emulator_ci -k 'system-images;android-34;google_apis;arm64-v8a' -d 'pixel_7'
51+
52+
- name: Boot AVD
53+
run: $ANDROID_HOME/emulator/emulator -avd emulator_ci
54+
55+
- name: Install pm2
56+
run: npm install pm2@latest -g
57+
58+
- name: Start metro
59+
run: |
60+
cd packages/mobile
61+
pm2 --name METRO start npm -- start
62+
63+
- name: Install Detox CLI
64+
run: npm install detox-cli --global
3465

3566
- name: Build Detox
3667
run: |
37-
export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home
3868
cd packages/mobile
3969
detox build -c android.emu.debug.ci
4070
4171
- name: Run basic tests
4272
run: |
4373
cd packages/mobile
4474
detox test starter -c android.emu.debug.ci
75+
76+
- name: Stop metro
77+
run: pm2 stop METRO
78+
79+
- name: Take screenshot
80+
if: always()
81+
run: | # TODO
82+
83+
- name: Upload screenshot
84+
if: always()
85+
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
86+
with:
87+
name: screenshot.png
88+
path: screenshot.png

.github/workflows/e2e-crossplatform.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ on:
88
- packages/state-manager/**
99
- packages/identity/**
1010
- packages/common/**
11+
- packages/e2e-tests/**
1112

1213
jobs:
1314
mac:

.github/workflows/e2e-ios.yml

Lines changed: 50 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,58 @@
1-
name: E2E iOS
1+
name: Detox E2E iOS
22

3-
on:
4-
push:
5-
paths:
6-
- packages/mobile/**
7-
- packages/backend/**
8-
- packages/state-manager/**
3+
on: workflow_dispatch
94

105
jobs:
116
detox-ios:
12-
timeout-minutes: 10
13-
runs-on: [self-hosted, macOS, ARM64, iOS]
7+
timeout-minutes: 25
8+
runs-on: [macos-latest-xlarge]
149

1510
steps:
1611
- uses: actions/checkout@v4
12+
13+
- uses: actions/setup-node@master
14+
with:
15+
node-version: 18.12.1
1716

1817
- name: Install dependencies
1918
run: |
20-
npm i
21-
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
19+
npm ci
20+
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}\'
2221
2322
- name: Pull binaries
2423
run: |
25-
git lfs install
24+
git lfs install --force
2625
git lfs pull
2726
2827
- name: Install pods
2928
run: |
3029
cd packages/mobile/ios
3130
pod install
3231
32+
- name: List simulator devices
33+
run: xcrun simctl list devices
34+
35+
- name: Boot simulator
36+
run: |
37+
UDID=$(xcrun simctl list devices | grep 'iPhone 15 (' | awk -F '[()]' '{print $2}' | awk 'NR==2')
38+
xcrun simctl boot "$UDID"
39+
40+
- name: Install pm2
41+
run: npm install pm2@latest -g
42+
43+
- name: Start metro
44+
run: |
45+
cd packages/mobile
46+
pm2 --name METRO start npm -- start
47+
48+
- name: Install Detox CLI
49+
run: npm install detox-cli --global
50+
51+
- name: Install applesimutils
52+
run: |
53+
brew tap wix/brew
54+
brew install applesimutils
55+
3356
- name: Build Detox
3457
run: |
3558
cd packages/mobile
@@ -39,3 +62,18 @@ jobs:
3962
run: |
4063
cd packages/mobile
4164
detox test starter -c ios.sim.debug.ci
65+
66+
- name: Stop metro
67+
run: pm2 stop METRO
68+
69+
- name: Take screenshot
70+
if: always()
71+
run: |
72+
/usr/bin/xcrun simctl io booted screenshot screenshot.png
73+
74+
- name: Upload screenshot
75+
if: always()
76+
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
77+
with:
78+
name: screenshot.png
79+
path: screenshot.png

.github/workflows/e2e-win.yml

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -92,27 +92,28 @@ jobs:
9292
max_attempts: 3
9393
shell: bash
9494
command: cd packages/e2e-tests && npm run test oneClient.test.ts
95-
96-
- name: Run multiple clients test
97-
uses: nick-fields/retry@14672906e672a08bd6eeb15720e9ed3ce869cdd4 # v2.9.0
98-
with:
99-
timeout_minutes: 30
100-
max_attempts: 3
101-
shell: bash
102-
command: cd packages/e2e-tests && npm run test multipleClients.test.ts
103-
95+
10496
- name: Run user profile test
10597
uses: nick-fields/retry@v2
10698
with:
10799
timeout_minutes: 25
108100
max_attempts: 3
109101
shell: bash
110102
command: cd packages/e2e-tests && npm run test userProfile.test.ts
111-
103+
112104
- name: Run invitation link test - Includes 2 separate application clients
113105
uses: nick-fields/retry@14672906e672a08bd6eeb15720e9ed3ce869cdd4 # v2.9.0
114106
with:
115-
timeout_minutes: 25
107+
timeout_minutes: 10
116108
max_attempts: 3
117109
shell: bash
118110
command: cd packages/e2e-tests && npm run test invitationLink.test.ts
111+
112+
113+
- name: Run multiple clients test
114+
uses: nick-fields/retry@14672906e672a08bd6eeb15720e9ed3ce869cdd4 # v2.9.0
115+
with:
116+
timeout_minutes: 30
117+
max_attempts: 3
118+
shell: bash
119+
command: cd packages/e2e-tests && npm run test multipleClients.test.ts

packages/e2e-tests/src/selectors.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,12 @@ export class App {
5151
console.log('App closed', this.buildSetup.dataDir)
5252
}
5353

54-
async cleanup() {
54+
async cleanup(force: boolean = false) {
5555
console.log(`Performing app cleanup`, this.buildSetup.dataDir)
5656
if (this.isOpened) {
5757
throw new Error(`App with dataDir ${this.buildSetup.dataDir} is still open, close before cleaning up!`)
5858
}
59-
this.buildSetup.clearDataDir()
59+
this.buildSetup.clearDataDir(force)
6060
}
6161

6262
get saveStateButton() {

packages/e2e-tests/src/tests/invitationLink.test.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ describe('New user joins using invitation link while having app opened', () => {
2626
beforeAll(async () => {
2727
ownerApp = new App()
2828
guestApp = new App({ defaultDataDir: true })
29+
if (process.platform === 'win32') {
30+
await guestApp.cleanup(true)
31+
}
2932
})
3033

3134
beforeEach(async () => {
@@ -143,7 +146,7 @@ describe('New user joins using invitation link while having app opened', () => {
143146
const copiedCode = url.hash.substring(1)
144147
expect(() => parseInvitationCode(copiedCode)).not.toThrow()
145148
const data = parseInvitationCode(copiedCode)
146-
const commandFull = `${command[process.platform as SupportedPlatformDesktop]} "${composeInvitationDeepUrl(data)}"`
149+
const commandFull = `${command[process.platform as SupportedPlatformDesktop]} ${process.platform === 'win32' ? '""' : ''} "${composeInvitationDeepUrl(data)}"`
147150
console.log(`Calling ${commandFull}`)
148151
execSync(commandFull)
149152
console.log('Guest opened invitation link')

packages/e2e-tests/src/utils.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,9 @@ export class BuildSetup {
5454
}
5555

5656
private getBinaryLocation() {
57-
console.log('filename', this.fileName)
5857
switch (process.platform) {
5958
case 'linux':
59+
console.log('filename', this.fileName)
6060
return `${__dirname}/../Quiet/${this.fileName ? this.fileName : BuildSetup.getEnvFileName()}`
6161
case 'win32':
6262
return `${process.env.LOCALAPPDATA}\\Programs\\@quietdesktop\\Quiet.exe`
@@ -234,8 +234,8 @@ export class BuildSetup {
234234
await this.driver?.close()
235235
}
236236

237-
public clearDataDir() {
238-
if (process.env.IS_CI === 'true') {
237+
public clearDataDir(force: boolean = false) {
238+
if (process.env.IS_CI === 'true' && !force) {
239239
console.warn('Not deleting data directory because we are running in CI')
240240
return
241241
}

packages/mobile/.detoxrc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ module.exports = {
7777
emulator_ci: {
7878
type: 'android.emulator',
7979
device: {
80-
avdName: 'Pixel_7_API_31',
80+
avdName: 'emulator_ci',
8181
},
8282
},
8383
},
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
export const BASIC = 5000
22
export const LONG = 20000
3-
export const STARTUP = 90000
3+
export const STARTUP = 120000

packages/mobile/ios/Podfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
require_relative '../node_modules/react-native/scripts/react_native_pods'
22

3-
platform :ios, '17.4'
3+
platform :ios, '17.1'
44

55
target 'Quiet' do
66
config = use_native_modules!

packages/mobile/ios/Podfile.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1393,6 +1393,6 @@ SPEC CHECKSUMS:
13931393
Tor: 39dc71bf048312e202608eb499ca5c74e841b503
13941394
Yoga: 13c8ef87792450193e117976337b8527b49e8c03
13951395

1396-
PODFILE CHECKSUM: 811e75c5d23ebd5b5f3e16c6dd4bae230db730d0
1396+
PODFILE CHECKSUM: eed49772dde039b0723324c813c83dd4c1af35f7
13971397

1398-
COCOAPODS: 1.14.3
1398+
COCOAPODS: 1.15.2

packages/mobile/ios/Quiet.xcodeproj/project.pbxproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5300,7 +5300,7 @@
53005300
INFOPLIST_FILE = Quiet/Info.plist;
53015301
INFOPLIST_KEY_CFBundleDisplayName = Quiet;
53025302
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.social-networking";
5303-
IPHONEOS_DEPLOYMENT_TARGET = 17.4;
5303+
IPHONEOS_DEPLOYMENT_TARGET = 17.1;
53045304
LD_RUNPATH_SEARCH_PATHS = (
53055305
"$(inherited)",
53065306
"@executable_path/Frameworks",
@@ -5396,7 +5396,7 @@
53965396
INFOPLIST_FILE = Quiet/Info.plist;
53975397
INFOPLIST_KEY_CFBundleDisplayName = Quiet;
53985398
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.social-networking";
5399-
IPHONEOS_DEPLOYMENT_TARGET = 17.4;
5399+
IPHONEOS_DEPLOYMENT_TARGET = 17.1;
54005400
LD_RUNPATH_SEARCH_PATHS = (
54015401
"$(inherited)",
54025402
"@executable_path/Frameworks",

0 commit comments

Comments
 (0)