forked from openstack/horizon
-
Notifications
You must be signed in to change notification settings - Fork 2
/
tox.ini
175 lines (154 loc) · 6.31 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
[tox]
envlist = pep8,py27{-horizon,-openstack_dashboard,dj18},py34,releasenotes
minversion = 1.6
skipsdist = True
[testenv]
basepython=python2.7
install_command = pip install -U {opts} {packages}
setenv =
VIRTUAL_ENV={envdir}
INTEGRATION_TESTS=0
SELENIUM_HEADLESS=0
SELENIUM_PHANTOMJS=0
NOSE_WITH_OPENSTACK=1
NOSE_OPENSTACK_SHOW_ELAPSED=1
deps =
-r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
commands =
horizon: {envpython} {toxinidir}/manage.py test horizon --settings=horizon.test.settings {posargs}
openstack_dashboard: {envpython} {toxinidir}/manage.py test openstack_dashboard --settings=openstack_dashboard.test.settings --exclude-dir=openstack_dashboard/test/integration_tests {posargs}
[testenv:py27]
commands =
{envpython} {toxinidir}/manage.py test horizon --settings=horizon.test.settings {posargs}
{envpython} {toxinidir}/manage.py test openstack_dashboard --settings=openstack_dashboard.test.settings --exclude-dir=openstack_dashboard/test/integration_tests {posargs}
# Django-1.8 is LTS
[testenv:py27dj18]
commands =
pip install django>=1.8,<1.9
{envpython} {toxinidir}/manage.py test horizon --settings=horizon.test.settings {posargs}
{envpython} {toxinidir}/manage.py test openstack_dashboard --settings=openstack_dashboard.test.settings --exclude-dir=openstack_dashboard/test/integration_tests {posargs}
[testenv:py34]
basepython = python3.4
setenv =
{[testenv]setenv}
PYTHONUNBUFFERED=1
commands =
{envpython} {toxinidir}/manage.py test --settings=horizon.test.settings horizon.test.tests {posargs}
{envpython} {toxinidir}/manage.py test --settings=openstack_dashboard.test.settings \
--exclude-dir=openstack_dashboard/test/integration_tests \
openstack_dashboard {posargs}
[testenv:pep8]
usedevelop = True
whitelist_externals =
git
rm
setenv =
{[testenv]setenv}
DJANGO_SETTINGS_MODULE=openstack_dashboard.test.settings
commands =
{[testenv:extractmessages_check]commands}
flake8
[testenv:extractmessages]
usedevelop = True
setenv =
{[testenv]setenv}
commands =
{envpython} {toxinidir}/setup.py extract_messages -F babel-django.cfg -o horizon/locale/django.pot --input-dirs horizon/
{envpython} {toxinidir}/setup.py extract_messages -F babel-djangojs.cfg -o horizon/locale/djangojs.pot --input-dirs horizon/
{envpython} {toxinidir}/setup.py extract_messages -F babel-django.cfg -o openstack_dashboard/locale/django.pot --input-dirs openstack_dashboard/
{envpython} {toxinidir}/setup.py extract_messages -F babel-djangojs.cfg -o openstack_dashboard/locale/djangojs.pot --input-dirs openstack_dashboard/
[testenv:extractmessages_check]
# Only checks to see if translation files can be extracted and cleans afterwards
usedevelop = True
whitelist_externals =
rm
setenv =
{[testenv]setenv}
commands =
{[testenv:extractmessages]commands}
rm horizon/locale/django.pot
rm horizon/locale/djangojs.pot
rm openstack_dashboard/locale/django.pot
rm openstack_dashboard/locale/djangojs.pot
[testenv:compilemessages]
usedevelop = False
commands =
/bin/bash {toxinidir}/run_tests.sh --compilemessages -N
[testenv:venv]
commands = {posargs}
[testenv:manage]
# Env to launch manage.py commands
commands = {envpython} {toxinidir}/manage.py {posargs}
[testenv:cover]
commands =
coverage erase
coverage run {toxinidir}/manage.py test horizon --settings=horizon.test.settings {posargs}
coverage run {toxinidir}/manage.py test openstack_dashboard --settings=openstack_dashboard.test.settings --exclude-dir=openstack_dashboard/test/integration_tests {posargs}
coverage combine
coverage xml
coverage html
[testenv:py27dj19]
commands = pip install django>=1.9,<1.10
/bin/bash run_tests.sh -N --no-pep8 {posargs}
[testenv:py27integration]
# Run integration tests only
setenv =
PYTHONHASHSEED=0
INTEGRATION_TESTS=1
SELENIUM_HEADLESS=1
NOSE_WITH_OPENSTACK=1
NOSE_OPENSTACK_SHOW_ELAPSED=1
basepython = python2.7
commands = nosetests openstack_dashboard.test.integration_tests {posargs}
[testenv:npm]
commands =
nodeenv -p
npm install
npm run {posargs:test}
[testenv:docs]
setenv = DJANGO_SETTINGS_MODULE=openstack_dashboard.test.settings
commands = {envpython} {toxinidir}/setup.py build_sphinx
[testenv:releasenotes]
commands = sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
[testenv:runserver]
commands = {envpython} {toxinidir}/manage.py runserver {posargs}
[testenv:tests_system_packages]
# Provide an environment for system packagers that dont want anything from pip
# Any extra deps needed for this env can be passed by setting TOX_EXTRA_DEPS
sitepackages = True
passenv = TOX_EXTRA_DEPS
# Sets deps to an empty list so nothing is installed from pip
deps =
commands =
pip install -U {env:TOX_EXTRA_DEPS:}
{envpython} {toxinidir}/manage.py test horizon --settings=horizon.test.settings {posargs}
{envpython} {toxinidir}/manage.py test openstack_dashboard --settings=openstack_dashboard.test.settings {posargs}
[flake8]
exclude = .venv,.git,.tox,dist,*openstack/common*,*lib/python*,*egg,build,panel_template,dash_template,local_settings.py,*/local/*,*/test/test_plugins/*,.ropeproject
# H405 multi line docstring summary not separated with an empty line
ignore = H405
max-complexity = 20
[hacking]
local-check-factory = horizon.hacking.checks.factory
import_exceptions = collections.defaultdict,
collections.OrderedDict,
django.conf.settings,
django.conf.urls.include,
django.conf.urls.patterns,
django.conf.urls.url,
django.core.urlresolvers.reverse,
django.core.urlresolvers.reverse_lazy,
django.template.loader.render_to_string,
django.test.utils.override_settings,
django.utils.encoding.force_text,
django.utils.html.conditional_escape,
django.utils.html.escape,
django.utils.http.urlencode,
django.utils.safestring.mark_safe,
django.utils.translation.npgettext_lazy,
django.utils.translation.pgettext_lazy,
django.utils.translation.ugettext_lazy,
django.utils.translation.ungettext_lazy,
operator.attrgetter,
StringIO.StringIO