forked from uisautomation/media-webapp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tox.ini
100 lines (94 loc) · 3.57 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
# Tox runner configuration
#
# The following optional environment variables can change behaviour. See the
# comments where they are used for more information.
#
# - TOXINI_ARTEFACT_DIR
# - TOXINI_FLAKE8_VERSION
# - TOXINI_WORK_DIR
#
[tox]
# Envs which should be run by default.
envlist=flake8,doc,py3
# Allow overriding toxworkdir via environment variable
toxworkdir={env:TOXINI_WORK_DIR:{toxinidir}/.tox}
# We do not actually ship a setup.py file which is used by our deployment.
# Django projects instead prefer to add the project directories to the Python
# path. (Or, with the current working directory being the project.) The
# skipsdist option tells tox it is OK to not run "setup.py install" for our
# project.
skipsdist=True
# The "_vars" section is ignored by tox but we place some useful shared
# variables in it to avoid needless repetition.
[_vars]
# Where to write build artefacts. We default to the "build" directory in the
# tox.ini file's directory. Override with the TOXINI_ARTEFACT_DIR environment
# variable.
build_root={env:TOXINI_ARTEFACT_DIR:{toxinidir}/build}
[testenv]
# Additional dependencies
deps=
-rrequirements/developer.txt
coverage
# Which environment variables should be passed into the environment.
passenv=
# Django configuration.
DJANGO_*
# Allow people to override the coverage report location should they so wish.
COVERAGE_FILE
DJANGO_FRONTEND_APP_BUILD_DIR
# Location of the coverage.xml file
COVERAGE_XML_FILE
# Specify the default environment. Note that tox will *always* use the testsuite
# settings unless overridden by TOX_DJANGO_SETTINGS_MODULE. Just setting
# DJANGO_SETTINGS_MODULE will not override it.
setenv=
LOOKUP_ROOT={env:LOOKUP_ROOT:http://lookupproxy.invalid/}
OAUTH2_TOKEN_URL={env:OAUTH2_TOKEN_URL:http://oauth2.invalid/token}
DJANGO_SETTINGS_MODULE={env:TOX_DJANGO_SETTINGS_MODULE:mediawebapp.settings.tox}
DJANGO_SECRET_KEY=ex561uglj%!8oh*umt3-@2-4yj*&dc8cznob*vmb0!9bryoc-$
TOX_STATIC_ROOT={[_vars]build_root}/static
# Make sure that the HTTP->HTTPS redirect is disabled when running the test
# suite.
DANGEROUS_DISABLE_HTTPS_REDIRECT=1
# How to run the test suite. Note that arguments passed to tox are passed on to
# the test command.
commands=
# This collectstatic step is required because we use whitenoise for static
# file serving and it requires that the static files directory be present and
# populated.
./manage.py collectstatic --noinput
coverage run --source={toxinidir} ./manage.py test {posargs}
coverage html --directory {[_vars]build_root}/htmlcov/
coverage report
coverage xml -o {env:COVERAGE_XML_FILE:{[_vars]build_root}/coverage.xml}
# Allow sitepackages setting to be overridden via TOX_SITEPACKAGES environment
# variable. The tox container uses this to avoid re-installing the same packages
# over and over again.
sitepackages={env:TOXINI_SITEPACKAGES:False}
[testenv:py3]
basepython=python3
# Build documentation
[testenv:doc]
basepython=python3
deps=
-rrequirements/base.txt
-rdoc/requirements.txt
commands=sphinx-build -a -v -b html doc/ {[_vars]build_root}/doc/
# Check for PEP8 violations
[testenv:flake8]
basepython=python3
deps=
-rrequirements/base.txt
# We specify a specific version of flake8 to avoid introducing "false"
# regressions when new checks are introduced. The version of flake8 used may
# be overridden via the TOXINI_FLAKE8_VERSION environment variable.
flake8=={env:TOXINI_FLAKE8_VERSION:3.5.0}
commands=
flake8 --version
flake8 .
# Run management commands
[testenv:manage]
basepython=python3
commands=
./manage.py {posargs}