forked from cfpb/consumerfinance.gov
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtox.ini
272 lines (239 loc) · 7.27 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
[tox]
skipsdist=True
tox_pip_extensions_ext_venv_update=True
# Run these envs when tox is invoked without -e
envlist=lint-{current}, validate-migrations, unittest-{current,future}
[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
# acceptance: Run a Django server and acceptance tests
# current: Use the current production Python, Django, Wagtail
# future: Use the latest production Python, Django, Wagtail
#
# These factors are expected to combine into the follow generative environments:
#
# lint-current
# lint-future
# unittest-current
# unittest-future
# acceptance-current
# acceptance-future
#
# These factors are expected to combine to be invoked with:
#
# tox -e lint-current
# tox -e lint-future
# tox -e unittest-current
# tox -e unittest-future
# tox -e acceptance-current
# tox -e acceptance-future
recreate=False
allowlist_externals=echo
changedir=
unittest: {[unittest-config]changedir}
acceptance: {[acceptance-config]changedir}
basepython=
current: {[current-config]basepython}
future: {[future-config]basepython}
deps=
current: {[current-config]deps}
future: {[future-config]deps}
lint: {[lint-config]deps}
unittest: {[unittest-config]deps}
acceptance: {[acceptance-config]deps}
passenv=
unittest: {[unittest-config]passenv}
acceptance: {[acceptance-config]passenv}
setenv=
unittest: {[unittest-config]setenv}
acceptance: {[acceptance-config]setenv}
commands=
lint: {[lint-config]commands}
unittest: {[unittest-config]commands}
acceptance: {[acceptance-config]commands}
[lint-config]
# Configuration necessary to lint Python files.
# Note: This is not an env and will not run if invoked. Use:
#
# tox -e lint-{current, future}
#
# To run Python linting.
deps=
flake8
isort
commands=
flake8
isort --check-only --diff cfgov
[unittest-config]
# Configuration necessary to run unittests.
# Note: This is not an env and will not run if invoked. Use:
#
# tox -e unittest-{current, future}
#
# To run unit tests.
changedir=
{toxinidir}/cfgov
passenv=
DATABASE_URL TEST_RUNNER
setenv=
GOVDELIVERY_ACCOUNT_CODE=fake_account_code
DJANGO_ADMIN_USERNAME=admin
DJANGO_ADMIN_PASSWORD=admin
LANG=en_US.UTF-8
LC_ALL=en_US.UTF-8
WAGTAIL_SHARING_HOSTNAME=content.localhost
DJANGO_SETTINGS_MODULE=cfgov.settings.test
DATABASE_URL={env:DATABASE_URL:postgres://cfpb:cfpb@localhost/cfgov}
deps=
-r{toxinidir}/requirements/libraries.txt
-r{toxinidir}/requirements/test.txt
commands=
coverage erase
{env:CI_CHECK_MIGRATIONS:echo "Skipping CI-only step"}
python -b -m coverage run --source='.' manage.py test {posargs}
[current-config]
# Configuration necessary for the production versions Python, Django and
# Wagtail
# Note: This is not an env and will not run if invoked. Use:
#
# tox -e unittest-current
# tox -e unittest
#
# To run unittests with the current production versions.
basepython=python3.6
deps=
-r{toxinidir}/requirements/django.txt
-r{toxinidir}/requirements/wagtail.txt
[future-config]
# Configuration necessary for upcoming versions of Python, Django, and
# Wagtail. This is the place where the "future" dependencies will need to be
# modified when we're ready to track new versions of Python, Django, or
# Wagtail.
# Note: This is not an env and will not run if invoked. Use:
#
# tox -e unittest-future
#
# To run unittests with the upcoming versions specified here.
basepython=python3.6
deps=
Django>=2.2,<3.0
wagtail==2.10.1
[acceptance-config]
# Configuration necessary to run acceptance tests using same
# virtualenv as backend tests.
# Note: This is not an env and will not run if invoked. Use:
#
# tox -e acceptance-{current, future}
#
# To run acceptance tests.
changedir=
{[unittest-config]changedir}
deps=
{[unittest-config]deps}
passenv=
USER
DISPLAY
SAUCE_USERNAME
SAUCE_ACCESS_KEY
SAUCE_SELENIUM_URL
SAUCE_TUNNEL
setenv=
DJANGO_LIVE_TEST_SERVER_ADDRESS=localhost:9000-9010
DJANGO_SETTINGS_MODULE=cfgov.settings.test_acceptance
commands=
./manage.py test {posargs}
## Standalone and user-friendly envs
[testenv:unittest]
# Invoke with: tox -e unittest
# This should run identically to tox -e unittest-current
recreate=False
basepython={[current-config]basepython}
envdir={toxworkdir}/unittest-current
deps=
{[current-config]deps}
{[unittest-config]deps}
commands={[unittest-config]commands}
[testenv:lint]
# Invoke with: tox -e lint
# This should run identically to tox -e lint-current
recreate=False
basepython={[current-config]basepython}
envdir={toxworkdir}/lint-current
deps={[lint-config]deps}
commands={[lint-config]commands}
[testenv:acceptance]
# Invoke with: tox -e acceptance
# Set up an environment against which acceptance tests can be run
recreate=False
changedir={[acceptance-config]changedir}
basepython={[current-config]basepython}
envdir={toxworkdir}/acceptance-current
deps=
{[current-config]deps}
{[acceptance-config]deps}
passenv={[acceptance-config]passenv}
setenv=
acceptance: {[acceptance-config]setenv}
LANG=en_US.UTF-8
LC_ALL=en_US.UTF-8
commands={[acceptance-config]commands}
[testenv:validate-assets]
# Invoke with: tox -e validate-assets
# Ensure all assets are generated without error.
recreate=False
changedir={toxinidir}
basepython={[current-config]basepython}
deps=
{[current-config]deps}
{[unittest-config]deps}
setenv=
DJANGO_SETTINGS_MODULE=cfgov.settings.production
DJANGO_STATIC_ROOT={toxinidir}/collectstatic
ALLOWED_HOSTS=["*"]
commands=
{toxinidir}/frontend.sh ci
{toxinidir}/cfgov/manage.py collectstatic --noinput
[testenv:validate-migrations]
# Invoke with: tox -e validate-migrations
# Ensure that we're not missing any migations
recreate=False
envdir={toxworkdir}/unittest-current
changedir={[unittest-config]changedir}
basepython={[current-config]basepython}
deps=
{[current-config]deps}
{[unittest-config]deps}
setenv=
DJANGO_SETTINGS_MODULE=cfgov.settings.production
DJANGO_STATIC_ROOT={toxinidir}/collectstatic
ALLOWED_HOSTS=["*"]
commands=
python manage.py makemigrations --dry-run --check
[testenv:validate-translations]
# Invoke with: tox -e validate-translations
# Ensure that there are no changes to translatable strings that aren't
# contained in the comitted portable object files.
# This ultimate tests whether the generated django.mo file has changed
# (the django.po file will change because it includes the date it was
# generated).
# NOTE: Requires gettext. Will overwrite any existing
# cfgov/locale/*/LC_MESSAGES/django.po files.
recreate=False
envdir={toxworkdir}/unittest-current
changedir={[unittest-config]changedir}
basepython={[current-config]basepython}
deps=
{[current-config]deps}
{[unittest-config]deps}
setenv={[unittest-config]setenv}
allowlist_externals=
git
commands=
python manage.py makemessages
python manage.py compilemessages
git diff --quiet locale/*/LC_MESSAGES/django.mo