watcher-dashboard/tox.ini
Akihiro Motoki 5a7ebe5016 Django 2.0 support and fix lower-constraints
Replace django.core.urlresolves with django.urls

(In Django 2.0) The django.core.urlresolvers module is removed
in favor of its new location, django.urls.
It was deprecated in Django 1.10:
https://docs.djangoproject.com/en/2.0/releases/1.10/#id3

To test the dashboard with python3 and Django 1.11,
python3-django111 job is added to tox.ini and a corresponding
entry is added to .zuul.yaml.

requirements.txt is also updated not to include horizon dependecies.
This allows horizon plugins not to track changes in basic stuffs
like Django.

KeyError from memoized decorator occurs in watcher-dashboard python3
tests but it seems it is not specific to Django 2.0 support,
so it is not touched. Hopefully it can be fixed later.

lower-constraints job is also fixed.
- Previously install_command specifies upper-constraints.txt even for
  lower-constraints tox env. As a result, lower-constraints job actually
  tests upper-constraints.
  This commit moves -c option for upper-constraints.txt to 'deps'.
- lower-constraints.txt is updated.
- nose-exclude 0.3.0 actually does not work. 0.5.0 needs to be used.

Change-Id: Ia98e4685f217c1e932d4b68b864cd9f52c88b134
2018-06-22 01:13:37 +09:00

72 lines
1.9 KiB
INI

[tox]
minversion = 1.6
envlist = py35,py27,pep8
skipsdist = True
[testenv]
usedevelop = True
setenv = VIRTUAL_ENV={envdir}
NOSE_WITH_OPENSTACK=1
NOSE_OPENSTACK_COLOR=1
NOSE_OPENSTACK_RED=0.05
NOSE_OPENSTACK_YELLOW=0.025
NOSE_OPENSTACK_SHOW_ELAPSED=1
DJANGO_SETTINGS_MODULE=watcher_dashboard.test.settings
# Note the hash seed is set to 0 until horizon can be tested with a
# random hash seed successfully.
PYTHONHASHSEED=0
whitelist_externals = /bin/bash
rm
find
deps =
-c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt}
-r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
commands =
rm -f .testrepository/times.dbm
find . -type f -name "*.pyc" -delete
find . -type d -name "__pycache__" -delete
python manage.py test --settings=watcher_dashboard.test.settings \
--exclude-dir=watcher_dashboard/test/integration_tests \
watcher_dashboard
[testenv:pep8]
commands = flake8
[testenv:venv]
commands = {posargs}
[testenv:py3-dj111]
basepython = python3
commands =
pip install django>=1.11,<2
{[testenv]commands}
[testenv:py27integration]
basepython = python2.7
commands = /bin/bash run_tests.sh -N --integration --selenium-headless {posargs}
[testenv:releasenotes]
commands = sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
[testenv:cover]
commands = python setup.py testr --coverage --testr-args='{posargs}'
[testenv:docs]
commands = python setup.py build_sphinx
[testenv:debug]
commands = oslo_debug_helper {posargs}
[flake8]
show-source = True
builtins = _
exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build,.ropeproject,tools
[testenv:lower-constraints]
basepython = python3
deps =
-c{toxinidir}/lower-constraints.txt
-r{toxinidir}/test-requirements.txt
-r{toxinidir}/requirements.txt