From 26a4b3eac05b50a2d27f9968f80a31454df925a2 Mon Sep 17 00:00:00 2001 From: Brian Haley Date: Thu, 12 Jul 2018 16:34:18 -0400 Subject: [PATCH] tox: Reuse envdirs This massively reduces the amount of time needed to install dependencies and saves a lot of disk space to boot. Modeled on Nova change, https://review.openstack.org/#/c/534382/ Change-Id: Icae3b6b2b0d014aec17b04b3b516b13b2fa47c5d --- tox.ini | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tox.ini b/tox.ini index c442c2229e1..0c750fdf6bf 100644 --- a/tox.ini +++ b/tox.ini @@ -24,6 +24,7 @@ commands = stestr run {posargs} [testenv:debug] basepython = python3 +envdir = {toxworkdir}/shared commands = oslo_debug_helper -t neutron/tests {posargs} [testenv:common] @@ -94,11 +95,13 @@ commands = [testenv:releasenotes] basepython = python3 +envdir = {toxworkdir}/docs deps = -r{toxinidir}/doc/requirements.txt commands = sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html [testenv:pep8] basepython = python3 +envdir = {toxworkdir}/shared deps = {[testenv]deps} commands= @@ -119,6 +122,7 @@ whitelist_externals = [testenv:cover] basepython = python3 +envdir = {toxworkdir}/shared setenv = {[testenv]setenv} PYTHON=coverage run --source neutron --parallel-mode @@ -135,11 +139,13 @@ commands = {posargs} [testenv:docs] basepython = python3 +envdir = {toxworkdir}/docs deps = -r{toxinidir}/doc/requirements.txt commands = sphinx-build -W -b html doc/source doc/build/html [testenv:linkcheck] basepython = python3 +envdir = {toxworkdir}/docs deps = -r{toxinidir}/doc/requirements.txt commands = sphinx-build -W -b linkcheck doc/source doc/build/linkcheck @@ -169,6 +175,7 @@ local-check-factory = neutron.hacking.checks.factory [testenv:bandit] basepython = python3 +envdir = {toxworkdir}/shared # B104: Possible binding to all interfaces # B303: blacklist calls: md5, sha1 # B311: Standard pseudo-random generators are not suitable for security/cryptographic purpose @@ -178,6 +185,7 @@ commands = bandit -r neutron -x tests -n5 -s B104,B303,B311,B604 [testenv:bashate] basepython = python3 +envdir = {toxworkdir}/shared commands = bash -c "find {toxinidir} \ -not \( -type d -name .tox\* -prune \) \ -not \( -type d -name .venv\* -prune \) \ @@ -191,6 +199,7 @@ commands = bash -c "find {toxinidir} \ [testenv:genconfig] basepython = python3 +envdir = {toxworkdir}/shared commands = {toxinidir}/tools/generate_config_file_samples.sh # This environment can be used to quickly validate that all needed system