-
Notifications
You must be signed in to change notification settings - Fork 6
226 lines (200 loc) · 6.74 KB
/
android-regression.yml
File metadata and controls
226 lines (200 loc) · 6.74 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
name: Android regression tests
run-name: '${{ inputs.RISK }} regressions on: ${{ inputs.BRANCH_TO_CHECKOUT }} (${{ inputs.APPIUM_REPO }})'
on:
workflow_dispatch:
inputs:
APK_URL:
description: 'url to test'
required: true
type: string
default: https://oxen.rocks/session-foundation/session-android/release/1.20.3/session-android-20241101T052421Z-be16d3bf9-universal.tar.xz
RISK:
description: 'risks to target'
required: false
type: choice
options:
- 'high-risk'
- 'medium-risk'
- 'low-risk'
- ''
APPIUM_REPO:
description: 'appium repo to checkout'
required: true
type: choice
options:
- session-foundation/session-appium
- burtonemily/session-appium
- bilb/session-appium
default: session-foundation/session-appium
BRANCH_TO_CHECKOUT:
description: 'branch to checkout'
required: true
type: string
default: test-ci-regression
# SHARD_NUMBER:
# description: 'shard number'
# required: true
# type: choice
# options:
# - '1'
# - '2'
# - '3'
# - '4'
# default: '1'
# SHARD_COUNT:
# description: 'shard count'
# required: true
# type: choice
# options:
# - '1'
# - '2'
# - '3'
# - '4'
# default: '1'
PLAYWRIGHT_RETRIES_COUNT:
description: 'retries of failing tests to do at most'
required: true
type: choice
options:
- '0'
- '1'
- '2'
default: '0'
PRINT_FAILED_TEST_LOGS:
description: 'print failed test logs (1 to enable)'
required: true
type: choice
options:
- '0'
- '1'
default: '0'
PRINT_ONGOING_TEST_LOGS:
description: 'print ongoing test logs (1 to enable)'
required: true
type: choice
options:
- '0'
- '1'
default: '0'
PLAYWRIGHT_WORKERS_COUNT:
description: 'number of workers to use - ONLY 1 WORKER IS SUPPORTED FOR ANDROID'
required: true
type: choice
options:
- '1'
- '2'
- '3'
default: '1'
# concurrency:
# group: ${{ github.workflow }}
# cancel-in-progress: true
jobs:
android-regression:
runs-on: [self-hosted, linux, X64, qa-android]
env:
IOS_APP_PATH_PREFIX: '../extracted/Session.app'
ANDROID_APK: '../extracted/session-android.apk'
APPIUM_ADB_FULL_PATH: '/opt/android/platform-tools/adb'
ANDROID_SDK_ROOT: '/opt/android'
PLAYWRIGHT_RETRIES_COUNT: ${{ github.event.inputs.PLAYWRIGHT_RETRIES_COUNT }}
PRINT_FAILED_TEST_LOGS: ${{ github.event.inputs.PRINT_FAILED_TEST_LOGS }}
PRINT_ONGOING_TEST_LOGS: ${{ github.event.inputs.PRINT_ONGOING_TEST_LOGS }}
PLAYWRIGHT_WORKERS_COUNT: 1
IOS_FIRST_SIMULATOR: '49651A15-3E14-4BAF-8B8E-0C630C35B8DD'
IOS_SECOND_SIMULATOR: '7CA21E47-56AC-4B76-82A4-1D5199515F38'
IOS_THIRD_SIMULATOR: 'FE1DEDC7-D530-41E7-9B38-86ED2DDB97CD'
IOS_FOURTH_SIMULATOR: '561C621C-2CEF-4FCC-87B7-E6221718D15C'
IOS_FIFTH_SIMULATOR: '5AA87E03-5831-4209-87A0-21E5ECDC490F'
IOS_SIXTH_SIMULATOR: '6FB10AF3-3970-46BA-B414-1206AA4E726D'
IOS_SEVENTH_SIMULATOR: '0BDA36C0-83F4-46DF-ADC9-FF30E969D4BD'
IOS_EIGHTH_SIMULATOR: '1C61A0B6-3085-46B6-9B2E-6E9A1B594944'
IOS_NINTH_SIMULATOR: '7C69D129-BD40-4BC0-9A0D-6A7E990F23E8'
IOS_TENTH_SIMULATOR: '275E0C5B-2458-4490-831D-4CE86C8EC704'
IOS_ELEVENTH_SIMULATOR: 'EA5C5BCB-1E3E-4FFC-88BB-8D1DE354BC3B'
IOS_TWELFTH_SIMULATOR: '41514F87-DC49-4C81-B60C-03D1F8653A42'
# echo "SHARD_NUMBER ${{ github.event.inputs.SHARD_NUMBER }}"
# echo "SHARD_COUNT ${{ github.event.inputs.SHARD_COUNT }}"
steps:
- uses: actions/checkout@v4
- name: Runner Details
run: |
echo "BRANCH_TO_CHECKOUT ${{ github.event.inputs.BRANCH_TO_CHECKOUT }}"
echo "APPIUM_REPO ${{ github.event.inputs.APPIUM_REPO }}"
echo "APK_URL ${{ github.event.inputs.APK_URL }}"
echo "RISK ${{ github.event.inputs.RISK }}"
- name: Download APK
run: |
wget -q -O session-android.apk.tar.xz ${{ github.event.inputs.APK_URL }}
ls
pwd
- name: Extract APK
run: |
tar xf session-android.apk.tar.xz
pwd
- name: Rename extracted folder
run: |
mv session-android-*universal extracted
ls extracted
mv extracted/*.apk extracted/session-android.apk
ls extracted
pwd
- uses: actions/checkout@v4
with:
repository: ${{ github.event.inputs.APPIUM_REPO }}
ref: ${{ github.event.inputs.BRANCH_TO_CHECKOUT }}
path: 'forked-session-appium'
lfs: true
- uses: actions/setup-node@v4
with:
# node-version-file: 'forked-session-appium/.nvmrc'
node-version: 18.15.0
- name: Install yarn
run: |
npm install -g yarn
corepack enable
yarn set version 4.1.1
- name: Install test dependencies
run: |
cd forked-session-appium
ls
git status
touch yarn.lock
yarn install --immutable
- name: Start Appium server
run: |
cd forked-session-appium
yarn "./node_modules/.bin/appium server --use-drivers=uiautomator2,xcuitest --port 8110 --allow-cors"
- name: Build the Android tests
run: |
cd forked-session-appium
yarn tsc
- name: Restart adb server
shell: bash
continue-on-error: true # just so we don't fail if adb wasn't already running
run: |
source ./scripts/ci.sh
adb kill-server;
adb start-server;
- name: Start emulators
shell: bash
run: |
source ./scripts/ci.sh
start_with_snapshots
- name: List all tests
run: |
cd forked-session-appium
pwd
npx playwright test --list --grep "@${{ github.event.inputs.RISK }}"
- name: Run the tests # ${{ github.event.inputs.SHARD_NUMBER }}/${{ github.event.inputs.SHARD_COUNT }}
run: |
cd forked-session-appium
pwd
echo "yarn test 'android @${{ github.event.inputs.RISK }}'"
yarn test 'android @${{ github.event.inputs.RISK }}'
- name: Kill all running emulators
if: always()
continue-on-error: true # just so we don't fail
shell: bash
run: |
source ./scripts/ci.sh
killall_emulators