-
-
Notifications
You must be signed in to change notification settings - Fork 295
320 lines (262 loc) · 9 KB
/
testing.yml
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
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
name: testing
on:
push:
branches: master
pull_request:
permissions: read-all
jobs:
sqlite:
name: sqlite / english
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.11]
kiwitcms-url: [tcms.kiwitcms.org, public.tenant.kiwitcms.org]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Configure ~/.tcms.conf for ${{ matrix.kiwitcms-url }}
run: |
echo "[tcms]" > ~/.tcms.conf
echo "url = https://${{ matrix.kiwitcms-url }}/xml-rpc/" >> ~/.tcms.conf
echo "username = kiwitcms-bot" >> ~/.tcms.conf
echo "password = ${{ secrets.TCMS_PASSWORD }}" >> ~/.tcms.conf
- name: Execute tests
run: |
sudo apt-get update
sudo apt-get install gettext
sudo mkdir /Kiwi
sudo chmod a+w /Kiwi
pip install -r requirements/devel.txt
pushd tcms/ && npm install --dev && ./node_modules/.bin/webpack && popd
pushd tcms/ && ./npm-install && popd
export LANG=en-us
# report to Kiwi TCMS only if we have access to secrets
if [ -n "${{ secrets.TCMS_PASSWORD }}" ]; then
pip install kiwitcms-django-plugin
export DJANGO_TEST_RUNNER="tcms_django_plugin.TestRunner"
export TCMS_PRODUCT=$GITHUB_REPOSITORY
# branch name or pull/123
export TCMS_PRODUCT_VERSION=$(echo $GITHUB_REF | sed "s|refs/heads/||" | sed "s|refs/||" | sed "s|/merge||")
# short commit number
export TCMS_BUILD=$(echo $GITHUB_SHA | cut -c1-7)
fi
make test
coverage report -m
- name: Send coverage to codecov.io
if: env.CODECOV_TOKEN
uses: codecov/codecov-action@v4
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
fail_ci_if_error: false
verbose: true
check_for_unapplied_migrations:
name: check for unapplied migrations
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.11]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install Python dependencies
run: |
sudo apt-get update
sudo apt-get install gettext
pip install -r requirements/devel.txt
pushd tcms/ && npm install --dev && ./node_modules/.bin/webpack && popd
pushd tcms/ && ./npm-install && popd
- name: Run test
run: |
export LANG=en-us
export TEST_DASHBOARD_CHECK_UNAPPLIED_MIGRATIONS=1
coverage run --source='.' ./manage.py test -v2 --noinput --settings=tcms.settings.test tcms.core.tests.test_views.TestDashboardCheckMigrations
coverage report -m
- name: Send coverage to codecov.io
if: env.CODECOV_TOKEN
uses: codecov/codecov-action@v4
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
fail_ci_if_error: false
verbose: true
without_internal_bugtracker:
name: without internal bugtracker
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.11]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Execute tests
run: |
sudo apt-get update
sudo apt-get install gettext
sudo mkdir /Kiwi
sudo chmod a+w /Kiwi
pip install -r requirements/devel.txt
pushd tcms/ && npm install --dev && ./node_modules/.bin/webpack && popd
pushd tcms/ && ./npm-install && popd
export LANG=en-us
export KIWI_DISABLE_BUGTRACKER=yes
make test
coverage report -m
- name: Send coverage to codecov.io
if: env.CODECOV_TOKEN
uses: codecov/codecov-action@v4
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
fail_ci_if_error: false
verbose: true
mariadb:
name: mariadb / slovenian
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.11]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Create database
run: |
docker compose pull db
docker compose run -d -p 3306:3306 --name kiwi_db db
docker images
sleep 20 # wait to initialize
docker exec -i kiwi_db mariadb -u root -pkiwi-1s-aw3s0m3 -e 'GRANT ALL PRIVILEGES ON test_kiwi.* TO kiwi;'
- name: Execute tests
run: |
sudo apt-get update
sudo apt-get install gettext
sudo mkdir /Kiwi
sudo chmod a+w /Kiwi
pip install -r requirements/devel.txt
pip install -r requirements/mariadb.txt
pushd tcms/ && npm install --dev && ./node_modules/.bin/webpack && popd
pushd tcms/ && ./npm-install && popd
export LANG=sl-si
TEST_DB=MariaDB make test
coverage report -m
- name: Send coverage to codecov.io
if: env.CODECOV_TOKEN
uses: codecov/codecov-action@v4
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
fail_ci_if_error: false
verbose: true
postgres:
name: postgres / french
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.11]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Create database
run: |
docker compose -f docker-compose.postgres pull db
docker compose -f docker-compose.postgres run -d -p 5432:5432 --name kiwi_db db
docker images
- name: Execute tests
run: |
sudo apt-get update
sudo apt-get install gettext
sudo mkdir /Kiwi
sudo chmod a+w /Kiwi
pip install -r requirements/devel.txt
pip install -r requirements/postgres.txt
pushd tcms/ && npm install --dev && ./node_modules/.bin/webpack && popd
pushd tcms/ && ./npm-install && popd
export LANG=fr-fr
TEST_DB=Postgres make test
coverage report -m
- name: Send coverage to codecov.io
if: env.CODECOV_TOKEN
uses: codecov/codecov-action@v4
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
fail_ci_if_error: false
verbose: true
docker:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.11]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Setup
run: |
sudo apt-get update
# remove stock FF package
sudo snap remove firefox
sudo apt-get remove firefox
sudo apt-get install git make wrk
# install beakerlib from source it doesn't ship DEB packages
if [ ! -f "/usr/share/beakerlib/beakerlib.sh" ]; then
git clone https://github.com/beakerlib/beakerlib.git
sudo make -C beakerlib/ install
fi
pip install -r requirements/devel.txt
# install Firefox and Geckodriver from Mozilla's DEB repository
# b/c Ubuntu 22.04 and later ships FF via snap package (a container)
# which causes issues with file access from RobotFramework tests
sudo apt-get install software-properties-common
sudo add-apt-repository --yes ppa:mozillateam/ppa
# prioritize the 3rd party repository
sudo tee /etc/apt/preferences.d/mozilla-firefox << EOF
Package: *
Pin: release o=LP-PPA-mozillateam
Pin-Priority: 1001
Package: firefox
Pin: version 1:1snap1-0ubuntu2
Pin-Priority: -1
EOF
sudo apt-get install firefox firefox-geckodriver
- name: Docker version info
run: |
docker --version
docker --help
docker compose --version
docker compose --help
- name: Execute tests
run: |
make test-docker-image
docker images
- name: Upload logs
uses: actions/upload-artifact@v4
if: always()
with:
name: testing-logs
path: |
./*.json
./*.html
./*.log
./wrk-logs-*/
./*docker.log
./*cookies*
./test*.txt