Browse code

Use common tempest tox venv and add plugin install variable

This commit adds a new variable to lib/tempest to provide the plugins
that should be installed into common tox venv that gets created. In
order to make this work the workarounds to handle migrating to a common
tox venv have to be removed otherwise the plugins could be installed in
a venv that isn't used.

Change-Id: I63658b8d8dfa999e0feb79f8f2968f2b32e3ff57
Depends-On: Iab2e6e04b6c5795a4d0c8214564106525b942308

Matthew Treinish authored on 2016/05/05 00:55:12
Showing 1 changed files
... ...
@@ -64,6 +64,10 @@ BUILD_TIMEOUT=${BUILD_TIMEOUT:-196}
64 64
 # have tempest installed in DevStack by default.
65 65
 INSTALL_TEMPEST=${INSTALL_TEMPEST:-"True"}
66 66
 
67
+# This variable is passed directly to pip install inside the common tox venv
68
+# that is created
69
+TEMPEST_PLUGINS=${TEMPEST_PLUGINS:-0}
70
+
67 71
 # Cinder/Volume variables
68 72
 TEMPEST_VOLUME_DRIVER=${TEMPEST_VOLUME_DRIVER:-default}
69 73
 TEMPEST_DEFAULT_VOLUME_VENDOR="Open Source"
... ...
@@ -519,17 +523,17 @@ function configure_tempest {
519 519
     tmp_cfg_file=$(mktemp)
520 520
     cd $TEMPEST_DIR
521 521
     if [[ "$OFFLINE" != "True" ]]; then
522
-        tox -revenv --notest
522
+        tox -revenv-tempest --notest
523 523
     fi
524
-    tox -evenv -- pip install -c $REQUIREMENTS_DIR/upper-constraints.txt -r requirements.txt
524
+    tox -evenv-tempest -- pip install -c $REQUIREMENTS_DIR/upper-constraints.txt -r requirements.txt
525 525
 
526 526
     # Auth:
527 527
     iniset $TEMPEST_CONFIG auth tempest_roles "Member"
528 528
     if [[ $TEMPEST_USE_TEST_ACCOUNTS == "True" ]]; then
529 529
         if [[ $TEMPEST_HAS_ADMIN == "True" ]]; then
530
-            tox -evenv -- tempest-account-generator -c $TEMPEST_CONFIG --os-username $admin_username --os-password "$password" --os-tenant-name $admin_project_name -r $TEMPEST_CONCURRENCY --with-admin etc/accounts.yaml
530
+            tox -evenv-tempest -- tempest-account-generator -c $TEMPEST_CONFIG --os-username $admin_username --os-password "$password" --os-tenant-name $admin_project_name -r $TEMPEST_CONCURRENCY --with-admin etc/accounts.yaml
531 531
         else
532
-            tox -evenv -- tempest-account-generator -c $TEMPEST_CONFIG --os-username $admin_username --os-password "$password" --os-tenant-name $admin_project_name -r $TEMPEST_CONCURRENCY etc/accounts.yaml
532
+            tox -evenv-tempest -- tempest-account-generator -c $TEMPEST_CONFIG --os-username $admin_username --os-password "$password" --os-tenant-name $admin_project_name -r $TEMPEST_CONCURRENCY etc/accounts.yaml
533 533
         fi
534 534
         iniset $TEMPEST_CONFIG auth use_dynamic_credentials False
535 535
         iniset $TEMPEST_CONFIG auth test_accounts_file "etc/accounts.yaml"
... ...
@@ -594,12 +598,10 @@ function install_tempest {
594 594
     # NOTE(mtreinish) Respect constraints in the tempest full venv, things that
595 595
     # are using a tox job other than full will not be respecting constraints but
596 596
     # running pip install -U on tempest requirements
597
-    if [[ -d .tox/tempest ]] ; then
598
-        $TEMPEST_DIR/.tox/tempest/bin/pip install -c $REQUIREMENTS_DIR/upper-constraints.txt -r requirements.txt
599
-        PROJECT_VENV["tempest"]=${TEMPEST_DIR}/.tox/tempest
600
-    else
601
-        $TEMPEST_DIR/.tox/full/bin/pip install -c $REQUIREMENTS_DIR/upper-constraints.txt -r requirements.txt
602
-        PROJECT_VENV["tempest"]=${TEMPEST_DIR}/.tox/full
597
+    $TEMPEST_DIR/.tox/tempest/bin/pip install -c $REQUIREMENTS_DIR/upper-constraints.txt -r requirements.txt
598
+    PROJECT_VENV["tempest"]=${TEMPEST_DIR}/.tox/tempest
599
+    if [[ $TEMPEST_PLUGINS != 0 ]] ; then
600
+        tox -evenv-tempest -- pip install $TEMPEST_PLUGINS
603 601
     fi
604 602
     popd
605 603
 }