horizon/tox.ini
Doug Hellmann fdd3c8b462 add lower-constraints job
Create a tox environment for running the unit tests against the lower
bounds of the dependencies.

Create a lower-constraints.txt to be used to enforce the lower bounds
in those tests.

Add openstack-tox-lower-constraints job to the zuul configuration.

See http://lists.openstack.org/pipermail/openstack-dev/2018-March/128352.html
for more details.

---

horizon specific change:
* Django minimum version is bumped to >=1.11 as horizon rocky
  dropped Django 1.8-1.10 support.
* django-babel needs to be bumped to 0.6.2 to support Django 2.0
  8762ff5dc0
* nose-exclude needs to be bumped to 0.5.0 to run horizon unit tests
  properly. According to my test, 0.4.0 also works but this is
  a testing dependency, so we don't need to care multiple versions much.
  Otherwise only one test is run for openstack_dashboard unit tests.

https://review.openstack.org/555402 allows us to bump lower requirements.

Co-Authored-By: Akihiro Motoki <amotoki@gmail.com>
Change-Id: I73c3e4531c57d015f6016ca00b056a6fd0d8fc1a
Depends-On: https://review.openstack.org/555034
Depends-On: https://review.openstack.org/555402
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
Signed-off-by: Akihiro Motoki <amotoki@gmail.com>
2018-03-26 04:44:42 +09:00

182 lines
5.1 KiB
INI

[tox]
envlist = pep8,py27,py35,py35dj20,releasenotes,npm
minversion = 2.3.2
skipsdist = True
[testenv]
install_command = pip install {opts} {packages}
usedevelop = True
setenv =
VIRTUAL_ENV={envdir}
INTEGRATION_TESTS=0
NOSE_WITH_OPENSTACK=1
NOSE_OPENSTACK_SHOW_ELAPSED=1
whitelist_externals =
bash
find
deps =
-c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt}
-r{toxinidir}/test-requirements.txt
-r{toxinidir}/requirements.txt
commands =
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}
[testenv:py35]
setenv =
PYTHONUNBUFFERED = 1
{[testenv]setenv}
commands = {[unit_tests]commands}
[testenv:py35dj20]
basepython = python3.5
deps =
-r{toxinidir}/test-requirements.txt
commands =
pip install django>=2.0,<2.1
{[unit_tests]commands}
[unit_tests]
commands =
find . -type f -name "*.pyc" -delete
bash {toxinidir}/tools/unit_tests.sh {envpython} {toxinidir} {posargs}
[testenv:pep8]
commands =
flake8 {posargs}
{envpython} {toxinidir}/manage.py extract_messages --verbosity 0 --check-only
bash {toxinidir}/tools/find_executables.sh
doc8 doc/source releasenotes/source releasenotes/notes
[testenv:cover]
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 run -a {toxinidir}/manage.py test openstack_auth --settings=openstack_auth.test.settings {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
[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 =
pip install django>=2.0,<2.1
{[testenv:manage]commands}
[flake8]
filename = *.py,django.wsgi
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/*
ignore =
# Enable the following hacking rules which are disabled by default
# 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
max-complexity = 20
# flake8-import-order configurations
import-order-style = pep8
application-import-names = horizon,openstack_dashboard
[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
[testenv:lower-constraints]
basepython = python3
deps =
-c{toxinidir}/lower-constraints.txt
-r{toxinidir}/test-requirements.txt
-r{toxinidir}/requirements.txt
commands =
{[unit_tests]commands}