From 7502d0f01ddeee8c8393a54ccd47b3dddfbfaad0 Mon Sep 17 00:00:00 2001 From: Stanislav Makar Date: Thu, 2 Apr 2015 13:34:32 +0000 Subject: [PATCH] Add the possibility to work without python virtualenv Add new option "-v" which runs tests without python virtualenv Closes-Bug: #1377183 DocImpact: Add to the paragraph http://docs.mirantis.com/fuel-dev/devops.html#environment-creation-via-devops-fuel-main If using system_tests.sh without virtualenv please pass the option "-v". Change-Id: Ica5dc4ec3cefdae9246fbb88ce6e441bbcc75b4d --- utils/jenkins/system_tests.sh | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/utils/jenkins/system_tests.sh b/utils/jenkins/system_tests.sh index a23886c64..3e9c63690 100755 --- a/utils/jenkins/system_tests.sh +++ b/utils/jenkins/system_tests.sh @@ -36,6 +36,7 @@ if you do need to override them. Uses ENV_NAME variable is set. -j (name) - Name of this job. Determines ISO name, Task name and used by tests. Uses Jenkins' JOB_NAME if not set +-v - Do not use virtual environment -V (dir) - Path to python virtual environment -i (file) - Full path to ISO file to build or use for tests. Made from iso dir and name if not set. @@ -128,10 +129,12 @@ GlobalVariables() { # only show what commands would be executed but do nothing # this feature is usefull if you want to debug this script's behaviour DRY_RUN="${DRY_RUN:=no}" + + VENV="${VENV:=yes}" } GetoptsVariables() { - while getopts ":w:j:i:t:o:a:A:m:U:r:b:V:l:dkKe:h" opt; do + while getopts ":w:j:i:t:o:a:A:m:U:r:b:V:l:dkKe:v:h" opt; do case $opt in w) WORKSPACE="${OPTARG}" @@ -184,6 +187,9 @@ GetoptsVariables() { d) DRY_RUN="yes" ;; + v) + VENV="no" + ;; h) ShowHelp exit 0 @@ -364,10 +370,12 @@ RunTest() { fi # run python virtualenv - if [ "${DRY_RUN}" = "yes" ]; then - echo . $VENV_PATH/bin/activate - else - . $VENV_PATH/bin/activate + if [ "${VENV}" = "yes" ]; then + if [ "${DRY_RUN}" = "yes" ]; then + echo . $VENV_PATH/bin/activate + else + . $VENV_PATH/bin/activate + fi fi if [ "${ENV_NAME}" = "" ]; then