From a0614472df8ec425ee0133a0419e1a1591b899d8 Mon Sep 17 00:00:00 2001 From: Stephen Finucane Date: Thu, 2 Aug 2018 11:31:41 +0100 Subject: [PATCH] tox: Ensure reused envdirs share the same deps In commit df669caf, we modified tox.ini to reuse a shared directory for environments with the same dependencies. The 'venv' directory was chosen as this seemed like a suitably generic target. However, the 'venv' target actually uses a non-default values for 'deps' as doc requirements are included to allow things like reno using this target. This means switching between the 'venv' target and any of the other other targets using this directory will result in the virtualenv being rebuilt each time. Resolve this by using an explicit directory for these shared environments. A single setting of 'deps' for one of the targets is removed to make this clear. Change-Id: I239606f5f354a5536b20b1d31ee81d80b4572106 --- tox.ini | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/tox.ini b/tox.ini index 427cf8efd0..be25b241b1 100644 --- a/tox.ini +++ b/tox.ini @@ -55,8 +55,7 @@ commands = [testenv:pep8] description = Run style checks. -deps = {[testenv]deps} -envdir = {toxworkdir}/venv +envdir = {toxworkdir}/shared commands = bash tools/flake8wrap.sh {posargs} # Check that all JSON files don't have \r\n in line. @@ -67,7 +66,7 @@ commands = [testenv:fast8] description = Run style checks on the changes made since HEAD~. For a full run including docs, use 'pep8' -envdir = {toxworkdir}/venv +envdir = {toxworkdir}/shared commands = bash tools/flake8wrap.sh -HEAD @@ -100,7 +99,7 @@ commands = {[testenv:functional]commands} [testenv:api-samples] -envdir = {toxworkdir}/venv +envdir = {toxworkdir}/shared setenv = {[testenv]setenv} GENERATE_SAMPLES=True @@ -111,17 +110,17 @@ commands = stestr slowest [testenv:genconfig] -envdir = {toxworkdir}/venv +envdir = {toxworkdir}/shared commands = oslo-config-generator --config-file=etc/nova/nova-config-generator.conf [testenv:genpolicy] -envdir = {toxworkdir}/venv +envdir = {toxworkdir}/shared commands = oslopolicy-sample-generator --config-file=etc/nova/nova-policy-generator.conf [testenv:genplacementpolicy] -envdir = {toxworkdir}/venv +envdir = {toxworkdir}/shared commands = oslopolicy-sample-generator --config-file=etc/nova/placement-policy-generator.conf @@ -130,7 +129,7 @@ commands = # section once we rely on coverage 4.3+ # # https://bitbucket.org/ned/coveragepy/issues/519/ -envdir = {toxworkdir}/venv +envdir = {toxworkdir}/shared setenv = {[testenv]setenv} PYTHON=coverage run --source nova --parallel-mode @@ -144,7 +143,7 @@ commands = coverage report [testenv:debug] -envdir = {toxworkdir}/venv +envdir = {toxworkdir}/shared commands = {[testenv]commands} oslo_debug_helper {posargs} @@ -213,7 +212,7 @@ commands = [testenv:bandit] # NOTE(browne): This is required for the integration test job of the bandit # project. Please do not remove. -envdir = {toxworkdir}/venv +envdir = {toxworkdir}/shared commands = bandit -r nova -x tests -n 5 -ll [flake8]