-
Notifications
You must be signed in to change notification settings - Fork 88
/
tox.ini
198 lines (176 loc) · 5.86 KB
/
tox.ini
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
[tox]
skipsdist = True
# Adding an environment to this list is not enough to get the tests to be
# executed on-demand by CI. You need to modify rake_modules/taskgen.rb too.
envlist = commit-message, admin, adminschema, py2-pep8, py3-pep8, mtail, nagios_common, grafana, tables_catalog, tslua, smart_data_dump, alerts, openstack_puppetenc, wmcs, wmcs-replica_cnf_api_service
[flake8]
max-line-length = 100
ignore =
# Default non-PEP8 ignores
# See <https://pycodestyle.readthedocs.io/en/latest/intro.html#error-codes>
E121, E123, E126, E133, E226, E241, E242, E704, W503,
# E402: module level import not at top of file
E402
exclude =
# Do not lint the tox runtime directory
.tox,
# Do not look in the standard ruby bundle directory
.bundle,
# Ignore user dotfiles and scripts
modules/admin/files/home,
# Upstream files that don't pass flake8 but should not be locally modified
modules/jupyterhub/files/jupyterhub_config.py,
modules/jupyterhub/files/nchp_config.py,
modules/letsencrypt/files/acme_tiny.py,
modules/mailman/files/mm_cfg.py,
modules/openstack/files/train/keystone/ldap-common-rocky-fixed.py,
modules/postgresql/files/check_postgres_replication_lag.py,
modules/varnish/files/varnishapi.py,
modules/rabbitmq/files/rabbitmqadmin.py,
# example script that gets vars from environment:
modules/openstack/files/bobcat/admin_scripts/wmcs-prod-example.sh,
modules/openstack/files/bobcat/admin_scripts/wmcs-prod-example.sh,
modules/backy2/files/sql.py,
# needs python3, handled by its own tox.ini
modules/envoyproxy
[testenv]
basepython = python2.7
deps =
pytest
[testenv:admin]
basepython = python3
deps =
{[testenv]deps}
sshpubkeys
PyYAML
commands = pytest modules/admin/data
[testenv:adminschema]
basepython = python3
deps =
{[testenv]deps}
PyYAML
jsonschema
yamllint
commands = python3 ./modules/admin/data/data_validate.py
[testenv:commit-message]
basepython = python3
deps = commit-message-validator>=2.0.0
commands = commit-message-validator validate
[testenv:py2-pep8]
basepython = python2.7
deps = flake8==3.3.0
# add --version as a fallback so `tox -r` runs clean
# ultimately disabling checks, otherwise flake8 will bork on python3 files
commands = flake8 {posargs:{env:TOX_PY2_FILES:--version}}
[testenv:py3-pep8]
basepython = python3
deps = flake8 >=3.3.0
# add --version as a fallback so `tox -r` runs clean
# ultimately disabling checks, otherwise flake8 will bork on python2 files
commands = flake8 {posargs:{env:TOX_PY3_FILES:--version}}
[testenv:mtail]
basepython = python3
commands = pytest modules/mtail/files
[testenv:alerts]
basepython = python3
commands = pytest modules/alerts/files
[testenv:nagios_common]
basepython = python3
commands = pytest modules/nagios_common/files/check_commands
deps =
{[testenv]deps}
requests
prometheus_client
[testenv:grafana]
basepython = python3
# Needed for python3-ldap installed in Docker
# The alternative would be to build python-ldap in the virtualenv, thus requiring headers (e.g. -dev
# packages) in the Docker image anyways.
sitepackages = True
commands = pytest modules/grafana/files
deps =
{[testenv]deps}
wmflib
[testenv:tslua]
basepython = python3
allowlist_externals = /bin/sh
# sh needed to use wildcard
commands = /bin/sh -c 'busted --verbose --helper=modules/profile/files/trafficserver/mock.helper.lua --lpath=modules/profile/files/trafficserver/?.lua ./modules/profile/files/trafficserver/*.lua'
[testenv:smart_data_dump]
basepython = python3
commands = pytest modules/smart/files
deps =
{[testenv]deps}
prometheus_client
[testenv:prometheus]
basepython = python3
commands = pytest modules/prometheus/files
[testenv:tables_catalog]
basepython = python3
commands = pytest modules/mediawiki/files/mariadb
deps =
pytest
pyyaml
jsonschema
[testenv:openstack_puppetenc]
basepython = python3
commands =
black --check --diff -l 100 -t py39 modules/openstack/files/puppet/master/encapi/
isort --check --diff -l 100 --profile black -t py39 modules/openstack/files/puppet/master/encapi/
deps =
black
isort
[testenv:wmcs]
basepython = python3
commands =
black --check --diff -l 100 -t py39 modules/profile/files/wmcs
isort --check --diff -l 100 --profile black -t py39 modules/profile/files/wmcs
pytest --ignore=modules/profile/files/wmcs/nfs modules/profile/files/wmcs {posargs}
# adding them bit by bit
mypy --check-untyped-defs modules/profile/files/wmcs
setenv =
PYTHONPATH = modules/openstack/files/clientpackages
deps =
black
isort
ldap3
pymysql
tenacity
mypy
prometheus-client
types-PyYAML
types-pymysql
types-requests
types-psutil
types-flask
requests-mock
types-setuptools
types-ldap3
# Remove this pin when the CI can run Python 3.9
openstacksdk<1.5.0
python-glanceclient
python-keystoneclient
python-novaclient
python-designateclient
python-cinderclient
python-troveclient
python-neutronclient
{[testenv]deps}
{[testenv:py3-pep8]deps}
# Needed here also as tox does not notice changes in -r included files, fixed in tox 4
toolforge-weld>=1.2.1
[testenv:wmcs-replica_cnf_api_service]
basepython = python3
allowlist_externals = {toxinidir}/modules/profile/files/wmcs/nfs/replica_cnf_web_fullstack_tests/run_ci.sh
commands =
flake8 modules/profile/files/wmcs/nfs/replica_cnf_api_service
pytest --disable-warnings modules/profile/files/wmcs/nfs/replica_cnf_api_service {posargs}
{toxinidir}/modules/profile/files/wmcs/nfs/replica_cnf_web_fullstack_tests/run_ci.sh
deps =
{[testenv]deps}
{[testenv:py3-pep8]deps}
-r{toxinidir}/modules/profile/files/wmcs/nfs/replica_cnf_api_service/requirements.txt
# Needed here also as tox does not notice changes in -r included files, fixed in tox 4
toolforge-weld>=1.2.1
bats-core-pkg
requests-mock