Skip to content

Commit 46a3b31

Browse files
authored
chore: Merge 4.65.0 into master (#6712)
2 parents 15217be + 056484f commit 46a3b31

File tree

413 files changed

+13842
-1831
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

413 files changed

+13842
-1831
lines changed

.eslintrc.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,14 @@ module.exports = {
33
'import/resolver': {
44
node: {
55
extensions: ['.ts', '.tsx', '.js', '.ios.js', '.android.js', '.native.js', '.ios.tsx', '.android.tsx']
6+
},
7+
typescript: {
8+
alwaysTryTypes: true,
9+
project: './tsconfig.json'
610
}
11+
},
12+
'import/parsers': {
13+
'@typescript-eslint/parser': ['.ts', '.tsx']
714
}
815
},
916
parser: '@babel/eslint-parser',
@@ -29,6 +36,8 @@ module.exports = {
2936
'jest/globals': true
3037
},
3138
rules: {
39+
'import/named': 'error',
40+
'import/no-unresolved': 'error',
3241
'import/extensions': [
3342
'error',
3443
'ignorePackages',
@@ -54,7 +63,7 @@ module.exports = {
5463
'jsx-a11y/href-no-hash': 0,
5564
'jsx-a11y/aria-role': 0,
5665
'import/prefer-default-export': 0,
57-
'import/no-cycle': 0,
66+
'import/no-cycle': 2,
5867
'import/order': [
5968
'error',
6069
{

.github/workflows/build-pr.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,12 @@ jobs:
8080
uses: ./.github/workflows/maestro-android.yml
8181
needs: [e2e-build-android]
8282
secrets: inherit
83+
strategy:
84+
matrix:
85+
shard: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]
86+
fail-fast: false
87+
with:
88+
shard: ${{ matrix.shard }}
8389

8490
e2e-build-ios:
8591
name: E2E Build iOS
@@ -93,4 +99,5 @@ jobs:
9399
if: ${{ github.repository == 'RocketChat/Rocket.Chat.ReactNative' }}
94100
uses: ./.github/workflows/maestro-ios.yml
95101
needs: [e2e-build-ios]
96-
secrets: inherit
102+
secrets: inherit
103+

.github/workflows/e2e-build-android.yml

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -28,21 +28,25 @@ jobs:
2828
- name: Checkout and Setup Node
2929
uses: ./.github/actions/setup-node
3030

31-
- name: Setup E2E Account
32-
uses: ./.github/actions/e2e-account
31+
- name: Cache Gradle dependencies
32+
uses: actions/cache@v4
3333
with:
34-
E2E_ACCOUNT: ${{ secrets.E2E_ACCOUNT }}
34+
path: |
35+
~/.gradle
36+
key: gradle-${{ runner.os }}-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
37+
restore-keys: |
38+
gradle-${{ runner.os }}-
3539
36-
- name: Cache Gradle dependencies
40+
- name: Cache Android build
3741
uses: actions/cache@v4
3842
with:
3943
path: |
40-
~/.gradle/caches/modules-2
41-
~/.gradle/caches/transforms-*
42-
~/.gradle/caches/build-cache-*
43-
key: gradle-transforms-v1-${{ runner.os }}-${{ hashFiles('**/*.gradle*', 'gradle-wrapper.properties') }}
44+
android/.gradle
45+
android/app/build
46+
android/app/.cxx
47+
key: android-build-${{ runner.os }}-${{ hashFiles('package.json', '**/*.gradle*', 'android/gradle.properties', 'android/settings.gradle') }}
4448
restore-keys: |
45-
gradle-transforms-v1-${{ runner.os }}-
49+
android-build-${{ runner.os }}-
4650
4751
- name: Set up JDK
4852
uses: actions/setup-java@v4
@@ -57,7 +61,6 @@ jobs:
5761
uses: gradle/actions/setup-gradle@v4
5862
with:
5963
gradle-version: wrapper
60-
cache-disabled: true
6164

6265
- name: Decode Keystore
6366
run: |
@@ -70,7 +73,7 @@ jobs:
7073
echo -e "org.gradle.jvmargs=-Xmx4g -XX:MaxMetaspaceSize=1g -Dfile.encoding=UTF-8" >> ./gradle.properties
7174
echo -e "android.useAndroidX=true" >> ./gradle.properties
7275
echo -e "android.enableJetifier=true" >> ./gradle.properties
73-
echo -e "reactNativeArchitectures=armeabi-v7a,arm64-v8a,x86,x86_64" >> ./gradle.properties
76+
echo -e "reactNativeArchitectures=x86_64" >> ./gradle.properties
7477
echo -e "APPLICATION_ID=chat.rocket.reactnative" >> ./gradle.properties
7578
echo -e "newArchEnabled=true" >> ./gradle.properties
7679
echo -e "hermesEnabled=true" >> ./gradle.properties

.github/workflows/e2e-build-ios.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ jobs:
7979
- name: Build iOS app
8080
run: |
8181
cd ios
82+
export RUNNING_E2E_TESTS=true
8283
bundle exec fastlane ios build_experimental_simulator \
8384
disable_xcpretty:false \
8485
skip_package_ipa:true \

.github/workflows/maestro-android.yml

Lines changed: 68 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,14 @@ name: Maestro Tests on Android
22

33
on:
44
workflow_call:
5+
inputs:
6+
shard:
7+
required: true
8+
type: string
59

610
jobs:
711
android-test:
12+
name: 'Android Tests'
813
runs-on: ubuntu-latest
914

1015
steps:
@@ -38,8 +43,63 @@ jobs:
3843
sudo udevadm control --reload-rules
3944
sudo udevadm trigger --name-match=kvm
4045
46+
- name: Create Maestro script
47+
run: |
48+
cat << 'EOF' > run-maestro.sh
49+
#!/bin/bash
50+
SHARD=${{ inputs.shard }}
51+
echo "Running shard: $SHARD"
52+
53+
adb shell settings put system show_touches 1
54+
adb install app-experimental-release.apk
55+
adb shell monkey -p chat.rocket.reactnative -c android.intent.category.LAUNCHER 1
56+
sleep 10
57+
adb shell am force-stop chat.rocket.reactnative
58+
export MAESTRO_DRIVER_STARTUP_TIMEOUT=120000
59+
60+
MAX_RETRIES=3
61+
ATTEMPT=1
62+
FINAL_EXIT_CODE=1
63+
64+
while [ $ATTEMPT -le $MAX_RETRIES ]; do
65+
echo "Attempt $ATTEMPT of $MAX_RETRIES"
66+
67+
echo "Starting screen recording..."
68+
adb shell screenrecord /sdcard/test_run.mp4 > /dev/null 2>&1 &
69+
RECORD_PID=$!
70+
71+
maestro test .maestro --exclude-tags=util --include-tags=test-$SHARD --format junit --output maestro-report.xml
72+
TEST_EXIT_CODE=$?
73+
74+
echo "Stopping screen recording..."
75+
kill -INT $RECORD_PID || true
76+
sleep 2
77+
78+
echo "Pulling video from device..."
79+
adb pull /sdcard/test_run.mp4 test_run_${SHARD}_attempt_${ATTEMPT}.mp4 || true
80+
adb shell rm /sdcard/test_run.mp4 || true
81+
82+
if [ $TEST_EXIT_CODE -eq 0 ]; then
83+
echo "Maestro passed on attempt $ATTEMPT"
84+
FINAL_EXIT_CODE=0
85+
break
86+
else
87+
echo "Maestro failed on attempt $ATTEMPT"
88+
fi
89+
90+
ATTEMPT=$((ATTEMPT+1))
91+
done
92+
93+
exit $FINAL_EXIT_CODE
94+
EOF
95+
96+
chmod +x run-maestro.sh
97+
env:
98+
SHARD: ${{ inputs.shard }}
99+
41100
- name: Start Android Emulator and Run Maestro Tests
42101
uses: reactivecircus/android-emulator-runner@v2
102+
timeout-minutes: 60
43103
with:
44104
api-level: 34
45105
disk-size: 4096M
@@ -51,24 +111,20 @@ jobs:
51111
force-avd-creation: false
52112
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
53113
disable-animations: true
54-
script: |
55-
adb install app-experimental-release.apk
56-
adb shell monkey -p chat.rocket.reactnative -c android.intent.category.LAUNCHER 1
57-
sleep 10
58-
adb shell am force-stop chat.rocket.reactnative
59-
export MAESTRO_DRIVER_STARTUP_TIMEOUT=120000
60-
maestro test .maestro --format junit --output maestro-report.xml
114+
script: ./run-maestro.sh
61115

62116
- name: Upload Test Report
63117
if: always()
64118
uses: actions/upload-artifact@v4
65119
with:
66-
name: Android Test Report
120+
name: Android Test Report - Shard ${{ inputs.shard }}
67121
path: maestro-report.xml
68-
69-
- name: Upload Maestro Logs
122+
retention-days: 7
123+
124+
- name: Upload Screen Recording
70125
if: always()
71126
uses: actions/upload-artifact@v4
72127
with:
73-
name: Android Maestro Logs
74-
path: ~/.maestro/tests/
128+
name: maestro-video-${{ inputs.shard }}
129+
path: test_run_${{ inputs.shard }}_attempt_*.mp4
130+
retention-days: 7

.maestro/helpers/login.yaml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,14 @@ onFlowStart:
1818
- tapOn:
1919
id: login-view-email
2020
- inputText: ${USERNAME || output.createdUser.email}
21-
- pressKey: enter
21+
- tapOn:
22+
text: '.*Username or email.*'
2223
- tapOn:
2324
id: login-view-password
2425
- inputText: ${PASSWORD || output.createdUser.password}
25-
- hideKeyboard
26+
- tapOn:
27+
text: Login
28+
index: 0
2629
- tapOn:
2730
id: login-view-submit
2831
- extendedWaitUntil:

.maestro/helpers/logout.yaml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,16 +49,19 @@ tags:
4949
commands:
5050
- extendedWaitUntil:
5151
visible:
52-
text: 'LOGOUT'
52+
id: 'android:id/button1'
5353
timeout: 60000
54-
- tapOn: 'LOGOUT'
54+
- tapOn:
55+
text: Logout
56+
index: 0
5557

5658
- runFlow:
5759
when:
5860
platform: iOS
5961
commands:
6062
- tapOn:
61-
point: '67%,57%'
63+
text: Logout
64+
index: 1
6265

6366
- extendedWaitUntil:
6467
visible:

.maestro/helpers/navigate-to-register.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ tags:
55

66
---
77
- tapOn: Workspace URL. Required.
8-
- inputText: ${output.data.server}
8+
- inputText: ${server || output.data.server}
99
- extendedWaitUntil:
1010
visible: 'Connect'
1111
timeout: 60000

.maestro/helpers/navigate-to-room-action.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ tags:
1010
id: 'room-view'
1111
commands:
1212
- runFlow:
13-
file: './navigate-to-room.yaml'
13+
file: './search-and-navigate-room.yaml'
1414
env:
1515
ROOM: ${ROOM}
1616

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
appId: chat.rocket.reactnative
2+
name: Open Deep Link
3+
tags:
4+
- 'util'
5+
6+
---
7+
- openLink:
8+
link: ${link}
9+
- runFlow:
10+
when:
11+
visible: '.*Open in.*'
12+
commands:
13+
- tapOn: Open

0 commit comments

Comments
 (0)