forked from cfpb/consumerfinance.gov
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tox.ini
276 lines (242 loc) · 7.45 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
[tox]
skipsdist=True
tox_pip_extensions_ext_venv_update=True
# Run these envs when tox is invoked without -e
envlist=lint-py{27}, unittest-py{27,36}-dj{111}-wag{113}-slow
[testenv]
# Factored env for running most things with a matrix of Python, Django, and
# Wagtail versions. Configuration of individual top-level factors like lint
# and unittest is done in their respective configuration sections below.
#
# Factors:
# lint: Lint Python files with flake8 and isort
# unittest: Run Python unittests
# missing-migrations: Test for missing Django migrations
# acceptance: Run a Django server and acceptance tests
# py27: Use Python 2.7
# py36: Use Python 3.6
# dj111: Use Django 1.11
# dj20: Use Django 2.0
# wag113: Use Wagtail 1.13
# wag20: Use Wagtail 2.0
#
# These factors are expected to combine into the follow generative environments:
#
# lint-py{27,36}
# unittest-py{27,36}-dj{111}-wag{113}-{fast,slow}
# unittest-py{36}-dj{20}-wag{20}-{fast,slow}
# missing-migrations-py{27,36}-dj{111}-wag{113}
# acceptance-py{27,36}-dj{111}-wag{113}-fast
#
# These factors are expected to combine to be invoked with:
#
# tox -e lint-py27
# tox -e lint-py36
# tox -e unittest-py27-dj111-wag113-fast
# tox -e unittest-py27-dj111-wag113-slow
# tox -e unittest-py36-dj111-wag113-fast
# tox -e unittest-py36-dj111-wag113-slow
# tox -e unittest-py36-dj20-wag20-fast
# tox -e unittest-py36-dj20-wag20-slow
# tox -e missing-migrations-py36-dj111-wag113
# tox -e acceptance-py27-dj111-wag113-fast
# tox -e acceptance-py36-dj111-wag113-fast
recreate=False
whitelist_externals=echo
changedir=
unittest: {[unittest]changedir}
acceptance: {[acceptance]changedir}
missing-migrations: {[missing-migrations]changedir}
basepython=
py27: python2.7
py36: python3.6
deps=
dj111: Django>=1.11,<1.12
dj20: Django>=2.0,<2.1
wag113: wagtail>=1.13,<1.14
wag20: wagtail>=2.0,<2.1
lint: {[lint]deps}
unittest: {[unittest]deps}
acceptance: {[acceptance]deps}
missing-migrations: {[missing-migrations]deps}
passenv=
fast: {[unittest]passenv}
slow: {[unittest]passenv}
unittest: {[unittest]passenv}
acceptance: {[acceptance]passenv}
setenv=
fast: {[fast]setenv}
slow: {[slow]setenv}
missing-migrations: {[missing-migrations]setenv}
unittest: {[unittest]setenv}
acceptance: {[acceptance]setenv}
commands=
lint: {[lint]commands}
unittest: {[unittest]commands}
acceptance: {[acceptance]commands}
missing-migrations: {[missing-migrations]commands}
[lint]
# Configuration values necessary to lint Python files.
# Note: This is not an env will not run if invoked. Use an invocation of:
#
# tox -e lint-py{27,36}
#
# To run Python linting.
deps=
flake8
isort
commands=
flake8
isort --check-only --diff --recursive cfgov
[unittest]
# Configuration values necessary to run unittests.
# Note: This is not an env will not run if invoked. Use an invocation of:
#
# tox -e unittest-py{27,36}-dj{111,20}-wag{113,20}-{fast,slow}
#
# To run unit tests.
changedir=
{toxinidir}/cfgov
passenv=
TRAVIS TRAVIS_JOB_ID TRAVIS_BRANCH TEST_DATABASE_URL TEST_RUNNER
# Set DJANGO_SETTINGS_MODULE based on {with,no}-migrations
setenv=
GOVDELIVERY_ACCOUNT_CODE=fake_account_code
DJANGO_STAGING_HOSTNAME=content.localhost
LANG=en_US.UTF-8
LC_ALL=en_US.UTF-8
deps=
-r{toxinidir}/requirements/libraries.txt
-r{toxinidir}/requirements/postgres.txt
-r{toxinidir}/requirements/test.txt
commands=
coverage erase
coverage run --source='.' manage.py test {posargs}
[fast]
# Configuration values necessary to run unittests without migrations.
# Note: This is not an env will not run if invoked. Use an invocation of:
#
# tox -e unittest-py{27,36}-dj{111}-wag{113}-fast
#
# To run unit tests.
setenv=
DJANGO_SETTINGS_MODULE=cfgov.settings.test_nomigrations
[slow]
# Configuration values necessary to run unittests with migrations.
# Note: This is not an env will not run if invoked. Use an invocation of:
#
# tox -e unittest-py{27,36}-dj{111}-wag{113}-slow
#
# To run unit tests.
setenv=
DJANGO_SETTINGS_MODULE=cfgov.settings.test
[missing-migrations]
# Configuration values necessary to run missing migrations test.
# Note: This is not an env will not run if invoked. Use an invocation of:
#
# tox -e missing-migrations-py{27,36}-dj111-wag113
#
# To run unit tests.
changedir=
{[unittest]changedir}
deps=
{[unittest]deps}
setenv=
DJANGO_SETTINGS_MODULE=cfgov.settings.test
commands=
./manage.py makemigrations --dry-run --check
[acceptance]
# Configuration values necessary to run acceptance tests using same
# virtualenv as backend tests.
# Note: This is not an env will not run if invoked. Use an invocation of:
#
# acceptance-py{27,36}-dj{111}-wag{113}-fast
#
# To run acceptance tests.
changedir=
{[unittest]changedir}
deps=
{[unittest]deps}
passenv=
USER
DISPLAY
SAUCE_USERNAME
SAUCE_ACCESS_KEY
SAUCE_SELENIUM_URL
SAUCE_TUNNEL
TRAVIS
setenv=
DJANGO_LIVE_TEST_SERVER_ADDRESS=localhost:9000-9010
DJANGO_SETTINGS_MODULE=cfgov.settings.test_acceptance
commands=
./manage.py test {posargs}
## Standalone and past-friendly envs
[testenv:lint]
# Invoke with: tox -e lint
# This should run identically to tox -e lint-py27
recreate=False
basepython=python2.7
envdir={toxworkdir}/lint-py27
deps={[lint]deps}
commands={[lint]commands}
[testenv:fast]
# Invoke with: tox -e fast
# This should run identically to tox -e unittest-py27-dj111-wag113-fast
recreate=False
changedir={[unittest]changedir}
basepython=python2.7
envdir={toxworkdir}/unittest-py27-dj111-wag113-fast
deps=
-r{toxinidir}/requirements/django.txt
-r{toxinidir}/requirements/wagtail.txt
{[unittest]deps}
setenv=
{[fast]setenv}
{[unittest]setenv}
commands={[unittest]commands}
[testenv:missing-migrations]
# Invoke with: tox -e missing-migrations
# This should run identically to tox -e unittest-py27-dj111-wag113-fast
recreate=False
changedir={[missing-migrations]changedir}
basepython=python2.7
envdir={toxworkdir}/unittest-py27-dj111-wag113-fast
deps=
-r{toxinidir}/requirements/django.txt
-r{toxinidir}/requirements/wagtail.txt
{[missing-migrations]deps}
setenv=
{[fast]setenv}
{[missing-migrations]setenv}
commands={[missing-migrations]commands}
[testenv:acceptance]
recreate=False
changedir={[acceptance]changedir}
basepython=python2.7
envdir={toxworkdir}/acceptance-py27-dj111-wag113
deps=
-r{toxinidir}/requirements/django.txt
-r{toxinidir}/requirements/wagtail.txt
{[acceptance]deps}
passenv={[acceptance]passenv}
setenv=
acceptance: {[acceptance]setenv}
LANG=en_US.UTF-8
LC_ALL=en_US.UTF-8
commands={[acceptance]commands}
[testenv:validate-assets]
# Invoke with: tox -e validate-assets
# Ensure all assets are generated without error.
recreate=False
changedir={toxinidir}
basepython=python2.7
deps=
-r{toxinidir}/requirements/base.txt
-r{toxinidir}/requirements/optional-public.txt
setenv=
DJANGO_SETTINGS_MODULE=cfgov.settings.production
DJANGO_STATIC_ROOT={toxinidir}/collectstatic
ALLOWED_HOSTS=["*"]
commands=
{toxinidir}/frontend.sh production
{toxinidir}/cfgov/manage.py collectstatic --noinput