forked from buildbot/buildbot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.bbtravis.yml
241 lines (214 loc) · 9.79 KB
/
.bbtravis.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
# BBTravis CI configuration file
language: unknown
label_mapping:
TWISTED: tw
SQLALCHEMY: sqla
SQLALCHEMY_MIGRATE: sqlam
latest: l
PYTHON: py
TESTS: t
DB_TYPE: db
WORKER_PYTHON: wp
env:
global:
- BUILDBOT_TEST_DB_URL=sqlite://
- NUM_CPU=700m
- MEMORY_SIZE=1G
- CHROME_BIN=/usr/bin/google-chrome
# Needed to ignore specific warns, otherwise, it'll warn a generic message
- SQLALCHEMY_WARN_20=1
matrix: []
matrix:
fast_finish: true
include:
# ruff, docs first as they're more likely to find issues
- env: PYTHON=3.9 TWISTED=latest SQLALCHEMY=latest TESTS=ruff
- env: PYTHON=3.9 TWISTED=latest SQLALCHEMY=latest TESTS=docs
- env: PYTHON=3.9 TESTS=mypy
# add js tests in separate job. Start it early because it is quite long
- env: PYTHON=3.9 TWISTED=latest SQLALCHEMY=latest TESTS=js_build NUM_CPU=2 MEMORY_SIZE=1G
- env: PYTHON=3.9 TWISTED=latest SQLALCHEMY=latest TESTS=js_unit NUM_CPU=2 MEMORY_SIZE=1G
- env: PYTHON=3.9 TWISTED=latest SQLALCHEMY=latest TESTS=e2e_react_whl NUM_CPU=2 MEMORY_SIZE=2G
- env: PYTHON=3.9 TWISTED=latest SQLALCHEMY=latest TESTS=e2e_react_tgz NUM_CPU=2 MEMORY_SIZE=2G
- env: PYTHON=3.12 TWISTED=latest SQLALCHEMY=latest TESTS=e2e_react_whl NUM_CPU=2 MEMORY_SIZE=2G
- env: PYTHON=3.12 TWISTED=latest SQLALCHEMY=latest TESTS=e2e_react_tgz NUM_CPU=2 MEMORY_SIZE=2G
# include "ci" string into the name of the status that is eventually submitted to Github, so
# that the codecov.io service would wait until this build is finished before creating report.
- env: PYTHON=3.9 TREQ=22.2.0 TWISTED=22.1.0 SQLALCHEMY=latest NUM_CPU=2 TESTS=trial
- env: PYTHON=3.9 TREQ=22.2.0 TWISTED=22.4.0 SQLALCHEMY=latest NUM_CPU=2 TESTS=trial
- env: PYTHON=3.9 TWISTED=latest SQLALCHEMY=1.4.52 NUM_CPU=2 TESTS=trial
- env: PYTHON=3.8 TWISTED=latest SQLALCHEMY=latest NUM_CPU=2 TESTS=ci/coverage
- env: PYTHON=3.9 TWISTED=latest SQLALCHEMY=latest NUM_CPU=2 TESTS=trial
- env: PYTHON=3.10 TWISTED=latest SQLALCHEMY=latest NUM_CPU=2 TESTS=trial
- env: PYTHON=3.11 TWISTED=latest SQLALCHEMY=latest NUM_CPU=2 TESTS=trial
- env: PYTHON=3.12 TWISTED=latest SQLALCHEMY=latest NUM_CPU=2 TESTS=trial
- env: PYTHON=3.9 TWISTED=latest SQLALCHEMY=latest NUM_CPU=2 TESTS=dev_virtualenv
# Worker-master interoperability tests
- env: PYTHON=3.9 TWISTED=latest SQLALCHEMY=latest TESTS=interop WORKER_PYTHON=3.9
- env: PYTHON=3.9 TWISTED=latest SQLALCHEMY=latest TESTS=interop WORKER_PYTHON=3.8
- env: PYTHON=3.9 TWISTED=latest SQLALCHEMY=latest TESTS=interop WORKER_PYTHON=3.7
# Worker tests on older python and twisted package combinations.
- env: PYTHON=3.7 TREQ=22.2.0 TWISTED=21.2.0 SQLALCHEMY=latest TESTS=trial_worker
- env: PYTHON=3.8 TREQ=22.2.0 TWISTED=21.2.0 SQLALCHEMY=latest TESTS=trial_worker
- env: PYTHON=3.9 TREQ=22.2.0 TWISTED=21.2.0 SQLALCHEMY=latest TESTS=trial_worker
# Configuration when SQLite database is persistent between running tests
# (by default in other tests in-memory SQLite database is used which is
# recreated for each test).
# Helps to detect issues with incorrect database setup/cleanup in tests.
- env: PYTHON=3.9 TWISTED=latest SQLALCHEMY=latest TESTS=trial BUILDBOT_TEST_DB_URL=sqlite:////tmp/test_db{TEST_ID}.sqlite DB_TYPE=sqlite
# Configuration that runs tests with real MySQL database (TODO does not work yet with our docker image)
- env: PYTHON=3.9 TWISTED=latest SQLALCHEMY=latest TESTS=trial BUILDBOT_TEST_DB_URL=mysql+mysqldb://[email protected]/bbtest{TEST_ID} DB_TYPE=mysql
- env: PYTHON=3.9 TWISTED=latest SQLALCHEMY=latest TESTS=trial BUILDBOT_TEST_DB_URL=mysql+mysqldb://[email protected]/bbtest{TEST_ID}?storage_engine=InnoDB
# Configuration that runs tests with real PostgreSQL database with pg8000 and psycopg2 drivers
# psycopg2 uses Peer Authentication which is configured in the dockerfile, while pg8000 use md5 auth with dummy password
- env: PYTHON=3.9 TWISTED=latest SQLALCHEMY=latest TESTS=trial BUILDBOT_TEST_DB_URL=postgresql+psycopg2:///bbtest{TEST_ID}
- env: PYTHON=3.9 TWISTED=latest SQLALCHEMY=latest TESTS=trial BUILDBOT_TEST_DB_URL='postgresql+pg8000:///bbtest{TEST_ID}?user=buildbot&password=x'
# Dependencies installation commands
install:
- title: setup virtualenv
cmd: |
rm -rf /tmp/bbvenv
python$PYTHON -m venv /tmp/bbvenv
- /tmp/bbvenv/bin/pip install -r requirements-pip.txt
- condition: TESTS not in ("dev_virtualenv", "e2e_react_whl", "e2e_react_tgz", "trial_worker")
cmd: /tmp/bbvenv/bin/pip install -r requirements-ci.txt
# On python 3.12 workaround done in dcbc28d1431e1aae892f7fdc0e266253365bc11e is no longer enough.
- condition: TESTS not in ("dev_virtualenv", "e2e_react_whl", "e2e_react_tgz", "trial_worker")
cmd: /tmp/bbvenv/bin/pip install -e master -e worker
- condition: TESTS == "dev_virtualenv"
cmd: /tmp/bbvenv/bin/pip install -r requirements-ci.txt -r requirements-ciworker.txt -r requirements-cidocs.txt
- condition: TESTS == "trial_worker"
cmd: /tmp/bbvenv/bin/pip install -r requirements-ciworker.txt
- condition: TESTS == "docs"
cmd: /tmp/bbvenv/bin/pip install -r requirements-cidocs.txt
- condition: '"sqlite" not in BUILDBOT_TEST_DB_URL'
cmd: /tmp/bbvenv/bin/pip install -r requirements-cidb.txt
- condition: TESTS == "interop"
cmd: |
set -e
rm -rf /tmp/bbworkervenv
python$WORKER_PYTHON -m venv /tmp/bbworkervenv
/tmp/bbworkervenv/bin/pip install -r requirements-pip.txt
/tmp/bbworkervenv/bin/pip install -r requirements-ciworker.txt
- title: pip installs for backward compat
cmd: |
# pip installs for backward compat
set -e
pkg_ver=""
if [ ! -z "$TREQ" ]; then
pkg_ver="${pkg_ver} treq==$TREQ"
fi
if [ "$TWISTED" = "trunk" ]; then
pkg_ver="${pkg_ver} git+https://github.com/twisted/twisted"
elif [ ! -z "$TWISTED" -a "$TWISTED" != "latest" ]; then
pkg_ver="${pkg_ver} Twisted==$TWISTED"
fi
if [ ! -z "$SQLALCHEMY" -a "$SQLALCHEMY" != "latest" ]; then
pkg_ver="${pkg_ver} sqlalchemy==$SQLALCHEMY"
fi
if [ ! -z "$pkg_ver" ]; then
/tmp/bbvenv/bin/python -m pip install ${pkg_ver}
fi
- step: !ShellCommand
command: "/tmp/bbvenv/bin/pip check"
warnOnFailure: True
flunkOnFailure: False
haltOnFailure: False
name: "pip check"
title: "pip check"
before_script:
# create real database for tests
- condition: '"mysql" in BUILDBOT_TEST_DB_URL'
cmd: /prepare_mysql
- condition: '"postgresql" in BUILDBOT_TEST_DB_URL'
cmd: |
/prepare_postgres
# for pg8000 driver we can't use peer authentication or empty password, so set a dummy password
# This also serves as a way to wait that the database is ready
while ! psql -d bbtest -c 'ALTER USER "buildbot" WITH PASSWORD '"'x'"';' ; do sleep 1 ; done
# Tests running commands
script:
- title: frontend tests
condition: TESTS == "js_build"
cmd: |
export PATH=/tmp/bbvenv/bin/:$PATH
make frontend_install_tests
- title: frontend unit tests
condition: TESTS == "js_unit"
cmd: |
export PATH=/tmp/bbvenv/bin/:$PATH
export VITEST_MIN_THREADS=1
export VITEST_MAX_THREADS=8
make frontend_tests
- title: master and worker tests
condition: TESTS in ("dev_virtualenv", "trial")
cmd: /tmp/bbvenv/bin/trial -j8 --reporter=text --rterrors buildbot.test buildbot_worker.test
- title: interop tests
condition: TESTS == "interop"
cmd: |
SANDBOXED_WORKER_PATH=/tmp/bbworkervenv/bin/buildbot-worker \
/tmp/bbvenv/bin/coverage run --rcfile=.coveragerc \
/tmp/bbvenv/bin/trial --reporter=text --rterrors buildbot.test.integration.interop
- title: worker tests
condition: TESTS == "trial_worker"
cmd: /tmp/bbvenv/bin/trial --reporter=text --rterrors buildbot_worker.test
# run tests under coverage for latest only (it's slower..)
- title: coverage tests
condition: TESTS == "ci/coverage"
cmd: /tmp/bbvenv/bin/coverage run --rcfile=.coveragerc /tmp/bbvenv/bin/trial -j8 --reporter=text --rterrors buildbot.test buildbot_worker.test
- title: ruff
condition: TESTS == "ruff"
cmd: |
export PATH=/tmp/bbvenv/bin/:$PATH
ruff check `git ls-files |grep '.py$'` && \
ruff format --check `git ls-files |grep '.py$'`
- title: mypy
condition: TESTS == "mypy"
cmd: |
export PATH=/tmp/bbvenv/bin/:$PATH
(cd ./master && mypy --config-file ../pyproject.toml buildbot)
(cd ./worker && mypy --config-file ../pyproject.toml buildbot_worker)
# Build documentation
- title: docs
condition: TESTS == "docs"
cmd: |
export PATH=/tmp/bbvenv/bin/:$PATH
make docs-release
# Run spell checker on documentation
- title: spelling
condition: TESTS == "docs"
cmd: |
export PATH=/tmp/bbvenv/bin/:$PATH
make docs-release-spelling
- title: maketarballs
condition: TESTS in ("e2e_react_whl", "e2e_react_tgz")
cmd: |
export PATH=/tmp/bbvenv/bin/:$PATH
make tarballs
- title: end to end tests
condition: TESTS == "e2e_react_whl"
cmd: ./common/smokedist-react.sh whl
- title: tarballs end to end tests
condition: TESTS == "e2e_react_tgz"
cmd: ./common/smokedist-react.sh tar.gz
notifications:
email: false
after_script:
- |
# codecov
if [ $TESTS = ci/coverage ]; then
curl -Os https://uploader.codecov.io/v0.4.1/linux/codecov
echo "32cb14b5f3aaacd67f4c1ff55d82f037d3cd10c8e7b69c051f27391d2e66e15c codecov" | sha256sum --check
chmod +x ./codecov
CODECOV_TOKEN="b80c80d7-689d-46d7-b1aa-59168bb4c9a9" ./codecov
fi
# List installed packages along with their versions.
- "/tmp/bbvenv/bin/pip list"
sudo: false
branches:
# Only build main-line branches.
only:
- master
- eight
git:
depth: 300