2012-05-26 14:58:14 -04:00
[tox]
2018-03-11 10:30:21 +09:00
envlist = pep8,py27,py35,py35dj20,releasenotes,npm
2016-10-06 14:27:22 +01:00
minversion = 2.3.2
2013-12-09 14:17:48 +00:00
skipsdist = True
2012-05-26 14:58:14 -04:00
[testenv]
2018-03-08 07:18:36 -06:00
install_command = pip install {opts} {packages}
2017-11-30 06:37:30 +09:00
usedevelop = True
2015-12-17 13:23:36 +01:00
setenv =
VIRTUAL_ENV = {envdir}
INTEGRATION_TESTS = 0
NOSE_WITH_OPENSTACK = 1
NOSE_OPENSTACK_SHOW_ELAPSED = 1
2016-10-06 14:27:22 +01:00
whitelist_externals =
bash
2017-07-07 13:28:41 +03:00
find
2018-03-08 07:18:36 -06:00
deps =
-c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt}
2015-12-17 13:23:36 +01:00
-r{toxinidir}/test-requirements.txt
2018-03-08 07:18:36 -06:00
-r{toxinidir}/requirements.txt
2015-12-17 13:23:36 +01:00
commands =
2016-10-06 14:27:22 +01:00
horizon: {envpython} {toxinidir}/manage.py test --settings = horizon.test.settings {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}
2012-05-26 14:58:14 -04:00
2016-09-06 12:15:50 +10:00
[testenv:py35]
setenv =
2016-10-06 14:27:22 +01:00
PYTHONUNBUFFERED = 1
2016-09-06 12:15:50 +10:00
{[testenv]setenv}
2016-10-06 14:27:22 +01:00
commands = {[unit_tests]commands}
2016-09-06 12:15:50 +10:00
2017-11-30 06:37:30 +09:00
[testenv:py35dj20]
basepython = python3.5
deps =
-r{toxinidir}/test-requirements.txt
commands =
2018-03-11 10:30:21 +09:00
pip install django> = 2.0,<2.1
2017-11-30 06:37:30 +09:00
{[unit_tests]commands}
2016-10-06 14:27:22 +01:00
[unit_tests]
2017-07-07 13:28:41 +03:00
commands =
find . -type f -name "*.pyc" -delete
bash {toxinidir}/tools/unit_tests.sh {envpython} {toxinidir} {posargs}
2015-12-17 13:23:36 +01:00
2016-10-06 14:27:22 +01:00
[testenv:pep8]
2018-03-22 06:46:10 +09:00
# sphinx (precisely Pygments) needs to be installed to make doc8 work properly
deps =
{[testenv]deps}
-r{toxinidir}/doc/requirements.txt
2015-12-17 13:23:36 +01:00
commands =
2017-11-22 14:47:09 +00:00
flake8 {posargs}
2017-11-22 14:45:04 +00:00
{envpython} {toxinidir}/manage.py extract_messages --verbosity 0 --check-only
bash {toxinidir}/tools/find_executables.sh
2018-01-06 23:52:39 +09:00
doc8 doc/source releasenotes/source releasenotes/notes
2012-05-26 14:58:14 -04:00
2015-12-17 13:23:36 +01:00
[testenv:cover]
commands =
coverage erase
coverage run {toxinidir}/manage.py test horizon --settings = horizon.test.settings {posargs}
2016-09-28 14:58:48 -06:00
coverage run -a {toxinidir}/manage.py test openstack_dashboard --settings = openstack_dashboard.test.settings --exclude-dir=openstack_dashboard/test/integration_tests {posargs}
2017-07-11 14:19:57 +01:00
coverage run -a {toxinidir}/manage.py test openstack_auth --settings = openstack_auth.test.settings {posargs}
2015-12-17 13:23:36 +01:00
coverage xml
coverage html
2014-02-10 12:47:53 -07:00
2016-10-06 14:27:22 +01:00
[testenv:selenium]
setenv =
{[testenv]setenv}
WITH_SELENIUM = 1
SKIP_UNITTESTS = 1
commands = {[unit_tests]commands}
2016-01-12 18:43:13 +00:00
2016-10-06 14:27:22 +01:00
[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}
2016-06-29 10:18:36 +01:00
2013-01-10 14:13:59 +00:00
[testenv:py27integration]
2015-12-17 13:23:36 +01:00
# Run integration tests only
2016-05-23 17:05:00 +03:00
passenv = AVCONV_INSTALLED
2015-12-17 13:23:36 +01:00
setenv =
PYTHONHASHSEED = 0
INTEGRATION_TESTS = 1
SELENIUM_HEADLESS = 1
NOSE_WITH_OPENSTACK = 1
NOSE_OPENSTACK_SHOW_ELAPSED = 1
2013-01-10 14:13:59 +00:00
basepython = python2.7
2015-12-17 13:23:36 +01:00
commands = nosetests openstack_dashboard.test.integration_tests {posargs}
2013-01-10 14:13:59 +00:00
2015-12-17 13:23:36 +01:00
[testenv:npm]
2017-04-20 16:37:49 -07:00
passenv =
HOME
DISPLAY
2015-12-17 13:23:36 +01:00
commands =
nodeenv -p
npm install
npm run {posargs:test}
2015-04-02 10:37:32 -06:00
2015-12-17 13:23:36 +01:00
[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
2017-02-06 15:52:35 -06:00
passenv = TOX_EXTRA_DEPS http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy NO_PROXY
2015-12-17 13:23:36 +01:00
# Sets deps to an empty list so nothing is installed from pip
deps =
commands =
pip install -U {env:TOX_EXTRA_DEPS:}
2016-10-06 14:27:22 +01:00
{[unit_tests]commands}
2015-12-17 13:23:36 +01:00
2017-07-08 20:53:45 +00:00
[testenv:docs]
2018-03-22 06:46:10 +09:00
# We need to install horizon dependecies to build module references
deps =
-c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt}
-r{toxinidir}/requirements.txt
-r{toxinidir}/doc/requirements.txt
2017-07-08 20:53:45 +00:00
commands =
sphinx-build -W -b html doc/source doc/build/html
[testenv:releasenotes]
2018-03-22 06:46:10 +09:00
# There is no need to install horizon.
usedevelop = False
deps =
-c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt}
-r{toxinidir}/doc/requirements.txt
2017-07-08 20:53:45 +00:00
commands =
sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
2017-11-30 06:37:30 +09:00
[testenv:manage]
# we don't need to install test-requirements.txt
# modules in requirements.txt are installed due to usedevelop=True
# so 'deps' can be empty.
deps =
commands = {envpython} {toxinidir}/manage.py {posargs}
[testenv:manage-py35dj20]
basepython = python3.5
deps = {[testenv:manage]deps}
commands =
2018-03-11 10:30:21 +09:00
pip install django> = 2.0,<2.1
2017-11-30 06:37:30 +09:00
{[testenv:manage]commands}
2013-04-20 23:22:39 -07:00
[flake8]
2017-11-16 00:31:18 -08:00
filename = *.py,django.wsgi
2017-10-09 11:45:57 +03:00
exclude = .venv,.git,.tox,dist,*lib/python*,*egg,build,panel_template,dash_template,local_settings.py,*/local/*,*/test/test_plugins/*,.ropeproject,node_modules,openstack_dashboard/enabled/*
2018-04-11 00:28:25 +09:00
# E402 module level import not at top of file
# W503 line break before binary operator
ignore = E402,W503
2017-05-17 20:44:42 +00:00
# Enable the following hacking rules which are disabled by default
2018-01-29 14:59:57 +07:00
# H106 Do not put vim configuration in source files.
# H203 Use assertIs(Not)None to check for None.
# H204 Use assert(Not)Equal to check for equality.
# H205 Use assert(Greater|Less)(Equal) for comparison.
# H904 Delay string interpolations at logging calls.
enable-extensions = H106,H203,H204,H205,H904
2015-03-30 13:30:17 +03:00
max-complexity = 20
2017-08-19 07:15:38 +00:00
# flake8-import-order configurations
2017-07-02 10:50:06 +00:00
import-order-style = pep8
2017-08-19 07:15:38 +00:00
application-import-names = horizon,openstack_dashboard
2014-01-03 17:31:49 +01:00
[hacking]
2015-09-21 13:22:59 +03:00
local-check-factory = horizon.hacking.checks.factory
2017-07-08 20:53:45 +00:00
[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
2018-03-22 12:46:04 -04:00
[testenv:lower-constraints]
basepython = python3
deps =
-c{toxinidir}/lower-constraints.txt
-r{toxinidir}/test-requirements.txt
-r{toxinidir}/requirements.txt
commands =
{[unit_tests]commands}