]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Run functional gate jobs in a constrained environment
authorarmando-migliaccio <armamig@gmail.com>
Thu, 17 Dec 2015 20:25:32 +0000 (12:25 -0800)
committerarmando-migliaccio <armamig@gmail.com>
Wed, 23 Dec 2015 03:31:59 +0000 (19:31 -0800)
This patch modifies the gate hooks to run jobs with upper constraints.

Change-Id: I9eb1eb8e61381e9bb45678af8a24fa88a99e2c8f

neutron/tests/contrib/post_test_hook.sh
tools/configure_for_func_testing.sh
tox.ini

index 867002d1e6cd0e8913c6b7b23839e0ffbd13d8f7..96bdc4d6048988663d3af13aedecf2a0ed4746ed 100644 (file)
@@ -35,7 +35,7 @@ function generate_testr_results {
 
     if [[ "$venv" == dsvm-functional* ]] || [[ "$venv" == dsvm-fullstack* ]]
     then
-        generate_test_logs "/tmp/${venv}-logs"
+        generate_test_logs $log_dir
     fi
 }
 
@@ -43,6 +43,7 @@ if [[ "$venv" == dsvm-functional* ]] || [[ "$venv" == dsvm-fullstack* ]]
 then
     owner=stack
     sudo_env=
+    log_dir="/tmp/${venv}-logs"
 elif [ "$venv" == "api" ]
 then
     owner=tempest
@@ -54,6 +55,10 @@ fi
 cd $NEUTRON_DIR
 sudo chown -R $owner:stack $NEUTRON_DIR
 
+# NOTE(armax): this is a gate hook and we should run in a constrained env
+# to avoid breakage from uncontrolled upper constraints
+venv=$venv-constraints
+
 # Run tests
 echo "Running neutron $venv test suite"
 set +e
index 54938a09c3735cc6b14ebddb0f267be2ee0be8d2..684e49026101f5ff3972cc28762194d2455c1fa7 100755 (executable)
@@ -50,6 +50,11 @@ done
 # Default to environment variables to permit the gate_hook to override
 # when sourcing.
 VENV=${VENV:-dsvm-functional}
+# If executed in the gate, run in a constrained env
+if [[ "$IS_GATE" == "True" ]]
+then
+    VENV=$VENV-constraints
+fi
 DEVSTACK_PATH=${DEVSTACK_PATH:-$1}
 PROJECT_NAME=${PROJECT_NAME:-neutron}
 REPO_BASE=${GATE_DEST:-$(cd $(dirname "$0")/../.. && pwd)}
diff --git a/tox.ini b/tox.ini
index 1b2a3c61e4fff9db655a6a018884af1aa83ca506..9710cb9a521876644d96ebbd82f49857e3fed9f7 100644 (file)
--- a/tox.ini
+++ b/tox.ini
@@ -28,6 +28,12 @@ setenv = {[testenv]setenv}
 # If you are running the tests locally you should set the env variable
 # TEMPEST_CONFIG_DIR=/opt/stack/tempest/etc
 
+[testenv:api-constraints]
+basepython = {[testenv:api]basepython}
+install_command = {[testenv:common-constraints]install_command}
+passenv = {[testenv:api]passenv}
+setenv = {[testenv:api]setenv}
+
 [testenv:common]
 # Fake job to define environment variables shared between dsvm/non-dsvm jobs
 setenv = OS_TEST_TIMEOUT=180
@@ -53,6 +59,13 @@ deps =
   {[testenv]deps}
   -r{toxinidir}/neutron/tests/functional/requirements.txt
 
+[testenv:functional-constraints]
+basepython = {[testenv:functional]basepython}
+install_command = {[testenv:common-constraints]install_command}
+setenv = {[testenv:functional]setenv}
+deps =
+  {[testenv:functional]deps}
+
 [testenv:functional-py34]
 basepython = python3.4
 setenv = {[testenv:functional]setenv}
@@ -67,6 +80,14 @@ sitepackages=True
 deps =
   {[testenv:functional]deps}
 
+[testenv:dsvm-functional-constraints]
+basepython = {[testenv:dsvm-functional]basepython}
+install_command = {[testenv:common-constraints]install_command}
+setenv = {[testenv:dsvm-functional]setenv}
+sitepackages={[testenv:dsvm-functional]sitepackages}
+deps =
+  {[testenv:functional-constraints]deps}
+
 [testenv:dsvm-functional-py34]
 basepython = python3.4
 setenv = {[testenv:dsvm-functional]setenv}
@@ -83,6 +104,14 @@ sitepackages=True
 deps =
   {[testenv:functional]deps}
 
+[testenv:dsvm-fullstack-constraints]
+install_command = {[testenv:common-constraints]install_command}
+setenv =
+  {[testenv:dsvm-fullstack]setenv}
+sitepackages={[testenv:dsvm-fullstack]sitepackages}
+deps =
+  {[testenv:functional-constraints]deps}
+
 [testenv:releasenotes]
 commands = sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html