-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
295 lines (292 loc) · 10.9 KB
/
docker-test.yml
File metadata and controls
295 lines (292 loc) · 10.9 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
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
name: Test Docker Selenium
on:
workflow_call:
inputs:
release:
description: 'Test a new release process'
required: false
type: string
default: 'false'
workflow_dispatch:
inputs:
request-timeout:
description: 'Test parameter for different request timeout'
required: false
default: '400'
parallel-hardening:
description: 'Test parameter to enable hardening parallel tests'
required: false
default: 'true'
log-level:
description: 'Test parameter for different log level'
required: false
default: 'INFO'
permissions:
contents: read
jobs:
build-and-test:
name: Test Docker Selenium
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- test-strategy: test
use-random-user: true
test-video: false
build-all: true
os: ubuntu-24.04
firefox-install-lang-package:
enable-managed-downloads:
- test-strategy: test
use-random-user: false
test-video: false
build-all: true
os: ubuntu-24.04
firefox-install-lang-package:
enable-managed-downloads:
- test-strategy: test_video
use-random-user: false
test-video: true
build-all: false
os: ubuntu-24.04
firefox-install-lang-package:
enable-managed-downloads:
retain-on-failure:
- test-strategy: test_video_dynamic_name
use-random-user: false
test-video: true
build-all: false
os: ubuntu-24.04
firefox-install-lang-package:
enable-managed-downloads:
retain-on-failure:
- test-strategy: test_video_standalone
use-random-user: false
test-video: true
build-all: false
os: ubuntu-24.04
firefox-install-lang-package:
enable-managed-downloads:
retain-on-failure:
- test-strategy: test_node_docker
use-random-user: false
test-video: true
build-all: false
os: ubuntu-24.04
firefox-install-lang-package:
enable-managed-downloads:
retain-on-failure:
- test-strategy: test_standalone_docker
use-random-user: false
test-video: true
build-all: false
os: ubuntu-24.04
firefox-install-lang-package:
enable-managed-downloads:
retain-on-failure:
- test-strategy: test_parallel
use-random-user: false
test-video: false
build-all: false
os: ubuntu-24.04
firefox-install-lang-package:
enable-managed-downloads:
- test-strategy: test_node_relay
use-random-user: false
test-video: false
build-all: false
os: ubuntu-24.04
firefox-install-lang-package:
enable-managed-downloads:
###
- test-strategy: test
use-random-user: true
test-video: false
build-all: true
os: ubuntu-24.04-arm
firefox-install-lang-package: false
enable-managed-downloads: false
- test-strategy: test
use-random-user: false
test-video: false
build-all: true
os: ubuntu-24.04-arm
firefox-install-lang-package: false
enable-managed-downloads: false
- test-strategy: test_video
use-random-user: false
test-video: true
build-all: false
os: ubuntu-24.04-arm
firefox-install-lang-package: true
enable-managed-downloads: true
retain-on-failure: true
- test-strategy: test_video_dynamic_name
use-random-user: false
test-video: true
build-all: false
os: ubuntu-24.04-arm
firefox-install-lang-package: true
enable-managed-downloads: true
retain-on-failure: true
- test-strategy: test_video_standalone
use-random-user: false
test-video: true
build-all: false
os: ubuntu-24.04-arm
firefox-install-lang-package: true
enable-managed-downloads: true
retain-on-failure: true
- test-strategy: test_node_docker_video_sidecar
use-random-user: false
test-video: true
build-all: false
os: ubuntu-24.04-arm
firefox-install-lang-package: true
enable-managed-downloads: false
retain-on-failure: true
- test-strategy: test_standalone_docker_video_sidecar
use-random-user: false
test-video: true
build-all: false
os: ubuntu-24.04-arm
firefox-install-lang-package: true
enable-managed-downloads: true
retain-on-failure: true
- test-strategy: test_parallel
use-random-user: false
test-video: false
build-all: false
os: ubuntu-24.04-arm
firefox-install-lang-package: false
enable-managed-downloads: true
- test-strategy: test_node_relay
use-random-user: false
test-video: false
build-all: false
os: ubuntu-24.04-arm
firefox-install-lang-package: true
enable-managed-downloads: true
steps:
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@main
with:
tool-cache: false
large-packages: false
- name: Checkout code
uses: actions/checkout@main
- name: Format and lint scripts
run: |
make format_shell_scripts
- name: Disable QEMU
if: matrix.test-strategy == 'test_node_relay' && contains(matrix.os, 'amd') == true
run: echo "DOCKER_ENABLE_QEMU=false >> $GITHUB_ENV"
- name: Set up containerd image store feature
uses: nick-invision/retry@master
with:
timeout_minutes: 10
max_attempts: 3
command: |
DOCKER_ENABLE_QEMU=${DOCKER_ENABLE_QEMU} make setup_dev_env
- name: Output Docker info
run: docker info
- name: Set up Python
uses: actions/setup-python@main
with:
python-version: '3.14'
check-latest: true
- name: Enable KVM
if: matrix.test-strategy == 'test_node_relay' && contains(matrix.os, 'arm') == false
run: |
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
sudo udevadm control --reload-rules
sudo udevadm trigger --name-match=kvm
- name: Get branch name (only for push to branch)
if: github.event_name == 'push'
run: echo "BRANCH=$(echo ${PUSH_BRANCH##*/})" >> $GITHUB_ENV
env:
PUSH_BRANCH: ${{ github.ref }}
- name: Get target branch name (only for PRs)
if: github.event_name == 'pull_request'
run: echo "BRANCH=$(echo ${TARGET_BRANCH##*/})" >> $GITHUB_ENV
env:
TARGET_BRANCH: ${{ github.head_ref }}
- name: Output branch name
run: echo ${BRANCH}
- name: Set Selenium base version
uses: ./.github/actions/get-latest-upstream
with:
release: ${{ inputs.release || false }}
gh_cli_token: ${{ secrets.GITHUB_TOKEN }}
authors: ${{ vars.AUTHORS || github.repository_owner }}
- name: Sets build date
run: |
echo "BUILD_DATE=$(date '+%Y%m%d')" >> $GITHUB_ENV
echo "AUTHORS=${AUTHORS}" >> $GITHUB_ENV
env:
AUTHORS: ${{ vars.AUTHORS || github.repository_owner }}
- name: Build Docker images
uses: nick-invision/retry@master
if: matrix.build-all == true
with:
timeout_minutes: 90
max_attempts: 3
retry_wait_seconds: 60
command: |
VERSION=${BRANCH} BUILD_DATE=${BUILD_DATE} make build
- name: Set test parameters
if: (github.event_name == 'schedule' || github.event_name == 'workflow_dispatch')
run: |
echo "LOG_LEVEL=${LOG_LEVEL}" >> $GITHUB_ENV
echo "TEST_PARALLEL_HARDENING=${TEST_PARALLEL_HARDENING}" >> $GITHUB_ENV
echo "REQUEST_TIMEOUT=${REQUEST_TIMEOUT}" >> $GITHUB_ENV
env:
LOG_LEVEL: ${{ github.event.inputs.log-level || 'INFO' }}
TEST_PARALLEL_HARDENING: ${{ github.event.inputs.parallel-hardening || 'true' }}
REQUEST_TIMEOUT: ${{ github.event.inputs.request-timeout || '400' }}
- name: Set environment variables
run: |
if [ -n "${TEST_FIREFOX_INSTALL_LANG_PACKAGE}" ]; then
echo "TEST_FIREFOX_INSTALL_LANG_PACKAGE=${TEST_FIREFOX_INSTALL_LANG_PACKAGE}" >> $GITHUB_ENV
fi
if [ -n "${SELENIUM_ENABLE_MANAGED_DOWNLOADS}" ]; then
echo "SELENIUM_ENABLE_MANAGED_DOWNLOADS=${SELENIUM_ENABLE_MANAGED_DOWNLOADS}" >> $GITHUB_ENV
fi
if [ -n "${TEST_RETAIN_ON_FAILURE}" ]; then
echo "TEST_RETAIN_ON_FAILURE=${TEST_RETAIN_ON_FAILURE}" >> $GITHUB_ENV
fi
env:
TEST_FIREFOX_INSTALL_LANG_PACKAGE: ${{ matrix.firefox-install-lang-package }}
SELENIUM_ENABLE_MANAGED_DOWNLOADS: ${{ matrix.enable-managed-downloads }}
TEST_RETAIN_ON_FAILURE: ${{ matrix.retain-on-failure }}
- name: Run Docker Compose to ${{ matrix.test-strategy }} on AMD64
if: contains(matrix.os, 'arm') == false
uses: nick-invision/retry@master
with:
timeout_minutes: 90
max_attempts: 2
retry_wait_seconds: 60
command: |
USE_RANDOM_USER_ID=${{ matrix.use-random-user }} VERSION=${BRANCH} BUILD_DATE=${BUILD_DATE} make ${{ matrix.test-strategy }}
- name: Run Docker Compose to ${{ matrix.test-strategy }} on ARM64
if: contains(matrix.os, 'arm') == true
uses: nick-invision/retry@master
with:
timeout_minutes: 90
max_attempts: 2
retry_wait_seconds: 60
command: |
USE_RANDOM_USER_ID=${{ matrix.use-random-user }} VERSION=${BRANCH} BUILD_DATE=${BUILD_DATE} \
TEST_FIREFOX_INSTALL_LANG_PACKAGE=${TEST_FIREFOX_INSTALL_LANG_PACKAGE} SELENIUM_ENABLE_MANAGED_DOWNLOADS=${SELENIUM_ENABLE_MANAGED_DOWNLOADS} \
TEST_RETAIN_ON_FAILURE=${TEST_RETAIN_ON_FAILURE} \
make ${{ matrix.test-strategy }}
- name: Upload recorded video
if: matrix.test-video == true
uses: actions/upload-artifact@main
with:
name: "${{ matrix.test-strategy }}_artifacts_${{ matrix.os }}"
path: ./tests/videos/
- name: Clean up Docker
if: always()
run: docker system prune -af