]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Avoid env variable duplication in tox.ini
authorCedric Brandily <zzelle@gmail.com>
Wed, 24 Jun 2015 19:31:33 +0000 (21:31 +0200)
committerCedric Brandily <zzelle@gmail.com>
Thu, 25 Jun 2015 18:51:26 +0000 (18:51 +0000)
Some environment variables are defined multiple times in tox.ini. This
change defines "fake" tox jobs and refactors existing jobs to reduce
duplicated environment variables.

Change-Id: I0ccebea4fbfff8dda34d1ed348b96b3b8ebd59e2

tox.ini

diff --git a/tox.ini b/tox.ini
index 070d983a2af73db0535eb86c135d53c254f760f2..f4a8c4a40f12dad9f838d59da4fb07d83bfdbff4 100644 (file)
--- a/tox.ini
+++ b/tox.ini
@@ -25,44 +25,47 @@ setenv = {[testenv]setenv}
          TEMPEST_CONFIG_DIR={env:TEMPEST_CONFIG_DIR:/opt/stack/tempest/etc}
          OS_TEST_API_WITH_REST=1
 
+[testenv:common]
+# Fake job to define environment variables shared between dsvm/non-dsvm jobs
+setenv = OS_TEST_TIMEOUT=180
+commands = false
+
+[testenv:dsvm]
+# Fake job to define environment variables shared between dsvm jobs
+setenv = OS_SUDO_TESTING=1
+         OS_ROOTWRAP_CMD=sudo {envdir}/bin/neutron-rootwrap {envdir}/etc/neutron/rootwrap.conf
+         OS_ROOTWRAP_DAEMON_CMD=sudo {envdir}/bin/neutron-rootwrap-daemon {envdir}/etc/neutron/rootwrap.conf
+         OS_FAIL_ON_MISSING_DEPS=1
+commands = false
+
 [testenv:functional]
 basepython = python2.7
 setenv = {[testenv]setenv}
+         {[testenv:common]setenv}
          OS_TEST_PATH=./neutron/tests/functional
-         OS_TEST_TIMEOUT=180
 deps =
   {[testenv]deps}
   -r{toxinidir}/neutron/tests/functional/requirements.txt
 
 [testenv:dsvm-functional]
 basepython = python2.7
-setenv = {[testenv]setenv}
-         OS_TEST_PATH=./neutron/tests/functional
-         OS_SUDO_TESTING=1
-         OS_ROOTWRAP_CMD=sudo {envdir}/bin/neutron-rootwrap {envdir}/etc/neutron/rootwrap.conf
-         OS_ROOTWRAP_DAEMON_CMD=sudo {envdir}/bin/neutron-rootwrap-daemon {envdir}/etc/neutron/rootwrap.conf
-         OS_FAIL_ON_MISSING_DEPS=1
-         OS_TEST_TIMEOUT=180
+setenv = {[testenv:functional]setenv}
+         {[testenv:dsvm]setenv}
 sitepackages=True
 deps =
   {[testenv:functional]deps}
 
 [testenv:fullstack]
 setenv = {[testenv]setenv}
+         {[testenv:common]setenv}
          OS_TEST_PATH=./neutron/tests/fullstack
-         OS_TEST_TIMEOUT=180
 deps =
   {[testenv]deps}
   -r{toxinidir}/neutron/tests/functional/requirements.txt
 
 [testenv:dsvm-fullstack]
-setenv = {[testenv]setenv}
-         OS_TEST_PATH=./neutron/tests/fullstack
-         OS_SUDO_TESTING=1
-         OS_ROOTWRAP_CMD=sudo {envdir}/bin/neutron-rootwrap {envdir}/etc/neutron/rootwrap.conf
-         OS_ROOTWRAP_DAEMON_CMD=sudo {envdir}/bin/neutron-rootwrap-daemon {envdir}/etc/neutron/rootwrap.conf
-         OS_FAIL_ON_MISSING_DEPS=1
-         OS_TEST_TIMEOUT=180
+setenv = {[testenv:fullstack]setenv}
+         {[testenv:dsvm]setenv}
 sitepackages=True
 deps =
   {[testenv:functional]deps}