forked from certbot/certbot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tox.ini
308 lines (280 loc) · 11.5 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
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
[tox]
# mypy doesn't current pass for us on Windows. Fixing that is being tracked by
# https://github.com/certbot/certbot/issues/7803.
envlist = {cover,lint}-{win,posix},mypy
skipsdist = true
[base]
pytest = python -m pytest {posargs}
# Paths are listed on one line because tox seems to have inconsistent
# behavior with substitutions that contain line continuations, see
# https://github.com/tox-dev/tox/issues/2069 for more info.
source_paths = acme/acme certbot/certbot certbot-apache/certbot_apache certbot-ci/certbot_integration_tests certbot-ci/snap_integration_tests certbot-ci/windows_installer_integration_tests certbot-compatibility-test/certbot_compatibility_test certbot-dns-cloudflare/certbot_dns_cloudflare certbot-dns-digitalocean/certbot_dns_digitalocean certbot-dns-dnsimple/certbot_dns_dnsimple certbot-dns-dnsmadeeasy/certbot_dns_dnsmadeeasy certbot-dns-gehirn/certbot_dns_gehirn certbot-dns-google/certbot_dns_google certbot-dns-linode/certbot_dns_linode certbot-dns-luadns/certbot_dns_luadns certbot-dns-nsone/certbot_dns_nsone certbot-dns-ovh/certbot_dns_ovh certbot-dns-rfc2136/certbot_dns_rfc2136 certbot-dns-route53/certbot_dns_route53 certbot-dns-sakuracloud/certbot_dns_sakuracloud certbot-nginx/certbot_nginx
[testenv]
platform =
win: win32
posix: ^(?!.*win32).*$
setenv =
PYTEST_ADDOPTS = {env:PYTEST_ADDOPTS:--numprocesses auto}
PYTHONHASHSEED = 0
# The default install command is python -I -m pip install {opts} {packages}
install_command = python -I {toxinidir}/tools/pip_install.py {opts} {packages}
deps =
-e acme[test]
-e certbot[test]
!win: -e certbot-apache[dev]
-e certbot-dns-cloudflare
-e certbot-dns-digitalocean
-e certbot-dns-dnsimple
-e certbot-dns-dnsmadeeasy
-e certbot-dns-gehirn
-e certbot-dns-google
-e certbot-dns-linode
-e certbot-dns-luadns
-e certbot-dns-nsone
-e certbot-dns-ovh
-e certbot-dns-rfc2136
-e certbot-dns-route53
-e certbot-dns-sakuracloud
-e certbot-nginx
whitelist_externals =
echo
false
# This and the next few testenvs are a workaround for
# https://github.com/tox-dev/tox/issues/2858.
commands =
echo "Unrecognized environment name {envname}"
false
[testenv:py-win]
commands =
{[base]pytest} acme certbot certbot-dns-cloudflare certbot-dns-digitalocean certbot-dns-dnsimple certbot-dns-dnsmadeeasy certbot-dns-gehirn certbot-dns-google certbot-dns-linode certbot-dns-luadns certbot-dns-nsone certbot-dns-ovh certbot-dns-rfc2136 certbot-dns-route53 certbot-dns-sakuracloud certbot-nginx
[testenv:py{,-posix}]
# We want to test everything we do on Windows plus the Apache plugin.
commands =
{[testenv:py-win]commands} certbot-apache
[testenv:py3{,8,9,10,11,12}]
commands = {[testenv:py]commands}
[testenv:py3.{8,9,10,11,12}]
commands = {[testenv:py]commands}
[testenv:oldest]
# Setting basepython allows the tests to fail fast if that version of Python
# isn't available instead of potentially trying to use a newer version of
# Python which is unlikely to work.
#
# This version should be kept in sync with the one declared in
# tools/pinning/oldest/pyproject.toml.
basepython = python3.8
setenv = CERTBOT_OLDEST=1
commands = {[testenv:py]commands}
[testenv:cover{,-posix}]
coverage_report = python -m coverage report
# These coverage report commands are used on both posix and windows
common_coverage_report_commands =
{[testenv:cover]coverage_report} --fail-under 99 --include certbot-dns-cloudflare/*
{[testenv:cover]coverage_report} --fail-under 99 --include certbot-dns-digitalocean/*
{[testenv:cover]coverage_report} --fail-under 99 --include certbot-dns-dnsimple/*
{[testenv:cover]coverage_report} --fail-under 99 --include certbot-dns-dnsmadeeasy/*
{[testenv:cover]coverage_report} --fail-under 99 --include certbot-dns-gehirn/*
{[testenv:cover]coverage_report} --fail-under 99 --include certbot-dns-google/*
{[testenv:cover]coverage_report} --fail-under 100 --include certbot-dns-linode/*
{[testenv:cover]coverage_report} --fail-under 99 --include certbot-dns-luadns/*
{[testenv:cover]coverage_report} --fail-under 99 --include certbot-dns-nsone/*
{[testenv:cover]coverage_report} --fail-under 98 --include certbot-dns-ovh/*
{[testenv:cover]coverage_report} --fail-under 99 --include certbot-dns-rfc2136/*
{[testenv:cover]coverage_report} --fail-under 94 --include certbot-dns-route53/*
{[testenv:cover]coverage_report} --fail-under 99 --include certbot-dns-sakuracloud/*
{[testenv:cover]coverage_report} --fail-under 98 --include certbot-nginx/*
commands =
{[testenv:py]commands} --cov --cov-report=
{[testenv:cover]coverage_report} --fail-under 100 --include acme/*
{[testenv:cover]coverage_report} --fail-under 95 --include certbot/*
{[testenv:cover]coverage_report} --fail-under 100 --include certbot-apache/*
{[testenv:cover]common_coverage_report_commands}
[testenv:cover-win]
commands =
{[testenv:py-win]commands} --cov --cov-report=
{[testenv:cover]coverage_report} --fail-under 99 --include acme/*
{[testenv:cover]coverage_report} --fail-under 96 --include certbot/*
{[testenv:cover]common_coverage_report_commands}
[testenv:lint{,-win,-posix}]
commands = python -m pylint --reports=n --rcfile=.pylintrc {[base]source_paths}
[testenv:mypy]
deps =
{[testenv]deps}
-e certbot-ci
commands = mypy {[base]source_paths}
[testenv:isolated-acme]
description = Tests acme without any Certbot components installed
deps = -e acme[test]
commands = {[base]pytest} acme
[testenv:isolated-certbot]
description = Tests Certbot without any additional plugins installed
deps =
{[testenv:isolated-acme]deps}
-e certbot[test]
commands = {[base]pytest} certbot
[testenv:isolated-{apache,cloudflare,digitalocean,dnsimple,dnsmadeeasy,gehirn,google,linode,luadns,nsone,ovh,rfc2136,route53,sakuracloud,nginx}]
description = Tests the plugin without installing any other plugins
deps =
{[testenv:isolated-certbot]deps}
apache: -e certbot-apache[dev]
cloudflare: -e certbot-dns-cloudflare
digitalocean: -e certbot-dns-digitalocean
dnsimple: -e certbot-dns-dnsimple
dnsmadeeasy: -e certbot-dns-dnsmadeeasy
gehirn: -e certbot-dns-gehirn
google: -e certbot-dns-google
linode: -e certbot-dns-linode
luadns: -e certbot-dns-luadns
nsone: -e certbot-dns-nsone
ovh: -e certbot-dns-ovh
rfc2136: -e certbot-dns-rfc2136
route53: -e certbot-dns-route53
sakuracloud: -e certbot-dns-sakuracloud
nginx: -e certbot-nginx
commands =
apache: {[base]pytest} certbot-apache
cloudflare: {[base]pytest} certbot-dns-cloudflare
digitalocean: {[base]pytest} certbot-dns-digitalocean
dnsimple: {[base]pytest} certbot-dns-dnsimple
dnsmadeeasy: {[base]pytest} certbot-dns-dnsmadeeasy
gehirn: {[base]pytest} certbot-dns-gehirn
google: {[base]pytest} certbot-dns-google
linode: {[base]pytest} certbot-dns-linode
luadns: {[base]pytest} certbot-dns-luadns
nsone: {[base]pytest} certbot-dns-nsone
ovh: {[base]pytest} certbot-dns-ovh
rfc2136: {[base]pytest} certbot-dns-rfc2136
route53: {[base]pytest} certbot-dns-route53
sakuracloud: {[base]pytest} certbot-dns-sakuracloud
nginx: {[base]pytest} certbot-nginx
[testenv:apacheconftest]
deps =
-e acme
-e certbot
-e certbot-apache
commands =
{toxinidir}/certbot-apache/certbot_apache/_internal/tests/apache-conf-files/apache-conf-test --debian-modules
passenv =
SERVER
[testenv:apacheconftest-external-with-pebble]
description = Run apacheconftest with pebble and Certbot outside of the tox virtual environment.
deps =
-e certbot-ci
commands =
{toxinidir}/certbot-apache/certbot_apache/_internal/tests/apache-conf-files/apache-conf-test-pebble.py --debian-modules
[testenv:apacheconftest-with-pebble]
deps =
{[testenv:apacheconftest]deps}
{[testenv:apacheconftest-external-with-pebble]deps}
commands = {[testenv:apacheconftest-external-with-pebble]commands}
[testenv:nginxroundtrip]
deps =
-e acme
-e certbot
-e certbot-apache
-e certbot-nginx
commands =
python certbot-compatibility-test/nginx/roundtrip.py certbot-compatibility-test/nginx/nginx-roundtrip-testdata
[testenv:modification]
deps =
commands =
python {toxinidir}/tests/modification-check.py
[testenv:apache_compat]
deps =
commands =
docker build -t certbot-compatibility-test -f certbot-compatibility-test/Dockerfile .
docker build -t apache-compat -f certbot-compatibility-test/Dockerfile-apache .
docker run --rm -t apache-compat -c apache.tar.gz -vvvv
whitelist_externals =
docker
passenv =
DOCKER_*
[testenv:nginx_compat]
deps =
commands =
docker build -t certbot-compatibility-test -f certbot-compatibility-test/Dockerfile .
docker build -t nginx-compat -f certbot-compatibility-test/Dockerfile-nginx .
docker run --rm -t nginx-compat -c nginx.tar.gz -vv -aie
whitelist_externals =
docker
passenv =
DOCKER_*
[testenv:integration]
deps =
-e acme
-e certbot
-e certbot-nginx
-e certbot-ci
commands =
{[base]pytest} certbot-ci/certbot_integration_tests \
--acme-server={env:ACME_SERVER:pebble} \
--cov=acme --cov=certbot --cov=certbot_nginx --cov-report= \
--cov-config=certbot-ci/certbot_integration_tests/.coveragerc
coverage report --include 'certbot/*' --show-missing --fail-under=65
coverage report --include 'certbot-nginx/*' --show-missing --fail-under=74
passenv = DOCKER_*
[testenv:integration-certbot]
deps =
-e acme
-e certbot
-e certbot-ci
commands =
{[base]pytest} certbot-ci/certbot_integration_tests/certbot_tests \
--acme-server={env:ACME_SERVER:pebble} \
--cov=acme --cov=certbot --cov-report= \
--cov-config=certbot-ci/certbot_integration_tests/.coveragerc
coverage report --include 'certbot/*' --show-missing --fail-under=62
[testenv:integration-dns-rfc2136]
deps =
-e acme
-e certbot
-e certbot-dns-rfc2136
-e certbot-ci
commands =
{[base]pytest} certbot-ci/certbot_integration_tests/rfc2136_tests \
--acme-server=pebble --dns-server=bind \
--numprocesses=1 \
--cov=acme --cov=certbot --cov=certbot_dns_rfc2136 --cov-report= \
--cov-config=certbot-ci/certbot_integration_tests/.coveragerc
coverage report --include 'certbot/*' --show-missing --fail-under=45
coverage report --include 'certbot-dns-rfc2136/*' --show-missing --fail-under=86
[testenv:integration-external]
description = Run integration tests with Certbot outside of the tox virtual environment.
deps =
-e certbot-ci
commands =
{[base]pytest} certbot-ci/certbot_integration_tests \
--acme-server={env:ACME_SERVER:pebble}
passenv = DOCKER_*
[testenv:integration-certbot-oldest]
deps =
-e acme
-e certbot
-e certbot-ci
basepython =
{[testenv:oldest]basepython}
commands =
{[base]pytest} certbot-ci/certbot_integration_tests/certbot_tests \
--acme-server={env:ACME_SERVER:pebble}
passenv = DOCKER_*
setenv = {[testenv:oldest]setenv}
[testenv:integration-nginx-oldest]
deps =
-e acme
-e certbot
-e certbot-nginx
-e certbot-ci
basepython =
{[testenv:oldest]basepython}
commands =
{[base]pytest} certbot-ci/certbot_integration_tests/nginx_tests \
--acme-server={env:ACME_SERVER:pebble}
passenv = DOCKER_*
setenv = {[testenv:oldest]setenv}
[testenv:test-farm-apache2]
passenv =
AWS_*
setenv = AWS_DEFAULT_REGION=us-east-1
changedir = letstest
deps = -e {toxinidir}/letstest
commands = {toxinidir}/tools/retry.sh letstest targets/targets.yaml {env:AWS_EC2_PEM_FILE} SET_BY_ENV scripts/test_apache2.sh --repo {toxinidir}