tox: Reuse envdirs

This massively reduces the amount of time needed to install dependencies
and saves a lot of disk space :-)

Borrowed from nova change https://review.openstack.org/#/c/534382/

Change-Id: I70bbc41a8f5f7992dc02a5baac632800a4d69acb
This commit is contained in:
Akihiro Motoki 2018-12-25 10:21:09 +09:00
parent 06ab7a5047
commit 09115c7151
1 changed files with 12 additions and 10 deletions

22
tox.ini
View File

@ -52,6 +52,7 @@ commands = {posargs}
[testenv:pep8]
basepython = python3
# NOTE: Due to doc dependencies, we don't share envdir with "venv".
# sphinx (precisely Pygments) needs to be installed to make doc8 work properly
deps =
{[testenv]deps}
@ -64,6 +65,7 @@ commands =
[testenv:cover]
basepython = python3
envdir = {toxworkdir}/venv
commands =
coverage erase
coverage run {toxinidir}/manage.py test horizon --settings=horizon.test.settings {posargs}
@ -74,6 +76,7 @@ commands =
[testenv:selenium]
basepython = python3
envdir = {toxworkdir}/venv
setenv =
{[testenv]setenv}
WITH_SELENIUM=1
@ -82,6 +85,7 @@ commands = {[unit_tests]commands}
[testenv:selenium-headless]
basepython = python3
envdir = {toxworkdir}/venv
setenv =
{[testenv]setenv}
SELENIUM_HEADLESS=1
@ -91,6 +95,7 @@ commands = {[unit_tests]commands}
[testenv:selenium-phantomjs]
basepython = python3
envdir = {toxworkdir}/venv
setenv =
{[testenv]setenv}
SELENIUM_PHANTOMJS=1
@ -99,6 +104,7 @@ setenv =
commands = {[unit_tests]commands}
[testenv:py27integration]
envdir = {toxworkdir}/py27
# Run integration tests only
passenv = AVCONV_INSTALLED
setenv =
@ -142,32 +148,28 @@ commands =
[testenv:releasenotes]
basepython = python3
# 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
envdir = {toxworkdir}/docs
deps = {[testenv:docs]deps}
commands =
sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
[testenv:manage]
basepython = python3
# 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 =
envdir = {toxworkdir}/venv
commands = {envpython} {toxinidir}/manage.py {posargs}
[testenv:runserver]
basepython = python3
envdir = {toxworkdir}/venv
commands = {envpython} {toxinidir}/manage.py runserver {posargs}
[testenv:bandit]
basepython = python3
envdir = {toxworkdir}/venv
commands = bandit -r horizon openstack_auth openstack_dashboard -n5 -x tests -ll
[testenv:bandit-baseline]
envdir = {toxworkdir}/bandit
envdir = {toxworkdir}/venv
basepython = python3
[flake8]