forked from starlingx-staging/stx-horizon
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tox.ini
186 lines (164 loc) · 5.51 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
[tox]
envlist = pep8,py27dj{18,19,110},py27,py35,releasenotes,npm
minversion = 2.3.2
skipsdist = True
[wrs]
# This configuration assumes that the tox tests are being run directly within
# the build tree therefore the {toxinitdir} variable points to a path within
# the source tree. For example:
# {MY_REPO}/addons/wr-cgcs/layers/cgcs/git/neutron
#
wrsdir = {toxinidir}/../../../../../..
cgcsdir = {[wrs]wrsdir}/addons/wr-cgcs/layers/cgcs
wrdeps = -e{[wrs]cgcsdir}/middleware/sysinv/recipes-common/cgts-client/cgts-client
-e{[wrs]cgcsdir}/git/python-neutronclient
-e{[wrs]cgcsdir}/git/python-cinderclient
-e{[wrs]cgcsdir}/middleware/sysinv/recipes-common/sysinv/sysinv
-e{[wrs]cgcsdir}/middleware/config/recipes-common/tsconfig/tsconfig
-e{[wrs]cgcsdir}/git/python-novaclient
-e{[wrs]cgcsdir}/git/python-ceilometerclient
-e{[wrs]cgcsdir}/git/distributedcloud-client
-e{[wrs]cgcsdir}/recipes-svcmgmt/service-mgmt-client/sm-client
-e{[wrs]cgcsdir}/middleware/patching/recipes-common/cgcs-patch/cgcs-patch
-e{[wrs]cgcsdir}/recipes-nfv/nfv/nfv-client
[testenv]
install_command = pip install -U {[wrs]wrdeps} -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt?h=stable/pike} {opts} {packages}
setenv =
VIRTUAL_ENV={envdir}
INTEGRATION_TESTS=0
NOSE_WITH_OPENSTACK=1
NOSE_OPENSTACK_SHOW_ELAPSED=1
whitelist_externals =
bash
find
deps =
-r{toxinidir}/tox-requirements.txt
-r{toxinidir}/test-requirements.txt
commands =
horizon: {envpython} {toxinidir}/manage.py test --settings=horizon.test.settings {posargs}
manage: {envpython} {toxinidir}/manage.py {posargs}
py27: {[unit_tests]commands}
py35: {[unit_tests]commands}
openstack_dashboard: {envpython} {toxinidir}/manage.py test --settings=openstack_dashboard.test.settings {posargs}
runserver: {envpython} {toxinidir}/manage.py runserver {posargs}
venv: {posargs}
[testenv:py27]
install_command = pip install -U {[wrs]wrdeps} {opts} {packages}
[testenv:py35]
setenv =
PYTHONUNBUFFERED = 1
{[testenv]setenv}
commands = {[unit_tests]commands}
[testenv:py27dj18]
commands =
pip install -U django>=1.8,<1.9
{[unit_tests]commands}
[testenv:py27dj19]
commands =
pip install -U django>=1.9,<1.10
{[unit_tests]commands}
[testenv:py27dj110]
commands =
pip install -U django>=1.10,<1.11
{[unit_tests]commands}
[testenv:py27dj111]
commands =
pip install -U django>=1.11,<2.0
{[unit_tests]commands}
[unit_tests]
commands =
find . -type f -name "*.pyc" -delete
bash {toxinidir}/tools/unit_tests.sh {envpython} {toxinidir} {posargs}
[testenv:pep8]
install_command = pip install -U {[wrs]wrdeps} {opts} {packages}
usedevelop = True
commands =
{envpython} {toxinidir}/manage.py extract_messages --verbosity 0 --check-only
flake8
[testenv:cover]
basepython = python2.7
install_command = pip install -U {[wrs]wrdeps} {opts} {packages}
commands =
coverage erase
coverage run {toxinidir}/manage.py test horizon --settings=horizon.test.settings {posargs}
coverage run -a {toxinidir}/manage.py test openstack_dashboard --settings=openstack_dashboard.test.settings --exclude-dir=openstack_dashboard/test/integration_tests {posargs}
coverage xml
coverage html
[testenv:selenium]
setenv =
{[testenv]setenv}
WITH_SELENIUM=1
SKIP_UNITTESTS=1
commands = {[unit_tests]commands}
[testenv:selenium-headless]
setenv =
{[testenv]setenv}
SELENIUM_HEADLESS=1
WITH_SELENIUM=1
SKIP_UNITTESTS=1
commands = {[unit_tests]commands}
[testenv:selenium-phantomjs]
setenv =
{[testenv]setenv}
SELENIUM_PHANTOMJS=1
WITH_SELENIUM=1
SKIP_UNITTESTS=1
commands = {[unit_tests]commands}
[testenv:py27integration]
# Run integration tests only
passenv = AVCONV_INSTALLED
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]
passenv =
HOME
DISPLAY
commands =
nodeenv -p
npm install
npm run {posargs:test}
[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 http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy NO_PROXY
# Sets deps to an empty list so nothing is installed from pip
deps =
commands =
pip install -U {env:TOX_EXTRA_DEPS:}
{[unit_tests]commands}
[testenv:docs]
commands =
doc8 doc/source
sphinx-build -W -b html doc/source doc/build/html
[testenv:releasenotes]
commands =
doc8 releasenotes/source releasenotes/notes
sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
[flake8]
exclude = .venv,.git,.tox,dist,*lib/python*,*egg,build,panel_template,dash_template,local_settings.py,*/local/*,*/test/test_plugins/*,.ropeproject,node_modules
ignore = H102
# Enable the following hacking rules which are disabled by default
# H203 Use assertIs(Not)None to check for None
# H904 Delay string interpolations at logging calls
enable-extensions=H203,H904
max-complexity = 33
import-order-style = pep8
[hacking]
local-check-factory = horizon.hacking.checks.factory
[doc8]
# File extensions to check
extensions = .rst, .yaml
# Maximal line length should be 80 but we have some overlong lines.
# Let's not get far more in.
max-line-length = 80
# Disable some doc8 checks:
# D000: Check RST validity
# - cannot handle "none" for code-block directive
ignore = D000