Add run_tests flag to run only selenium tests.
The new Jenkins job to run the selenium tests is running all of the python27 unittests as well which have their own job. Add a new flag, --only-selenium, to run only the selenium tests. This will allow Jenkins to better partition work and prevent redundancy. Change-Id: I70aac3b843434736159c4266b41f6ebd1f5109c7
This commit is contained in:
parent
6f838a09b8
commit
1118b29c7e
@ -91,6 +91,8 @@ class RequestFactoryWithMessages(RequestFactory):
|
|||||||
return req
|
return req
|
||||||
|
|
||||||
|
|
||||||
|
@unittest.skipIf(os.environ.get('SKIP_UNITTESTS', False),
|
||||||
|
"The SKIP_UNITTESTS env variable is set.")
|
||||||
class TestCase(django_test.TestCase):
|
class TestCase(django_test.TestCase):
|
||||||
"""
|
"""
|
||||||
Specialized base test case class for Horizon which gives access to
|
Specialized base test case class for Horizon which gives access to
|
||||||
|
12
run_tests.sh
12
run_tests.sh
@ -28,6 +28,7 @@ function usage {
|
|||||||
echo " -y, --pylint Just run pylint"
|
echo " -y, --pylint Just run pylint"
|
||||||
echo " -q, --quiet Run non-interactively. (Relatively) quiet."
|
echo " -q, --quiet Run non-interactively. (Relatively) quiet."
|
||||||
echo " Implies -V if -N is not set."
|
echo " Implies -V if -N is not set."
|
||||||
|
echo " --only-selenium Run only the Selenium unit tests"
|
||||||
echo " --with-selenium Run unit tests including Selenium tests"
|
echo " --with-selenium Run unit tests including Selenium tests"
|
||||||
echo " --runserver Run the Django development server for"
|
echo " --runserver Run the Django development server for"
|
||||||
echo " openstack_dashboard in the virtual"
|
echo " openstack_dashboard in the virtual"
|
||||||
@ -65,7 +66,8 @@ never_venv=0
|
|||||||
quiet=0
|
quiet=0
|
||||||
restore_env=0
|
restore_env=0
|
||||||
runserver=0
|
runserver=0
|
||||||
selenium=0
|
only_selenium=0
|
||||||
|
with_selenium=0
|
||||||
testargs=""
|
testargs=""
|
||||||
with_coverage=0
|
with_coverage=0
|
||||||
makemessages=0
|
makemessages=0
|
||||||
@ -87,7 +89,8 @@ function process_option {
|
|||||||
-c|--coverage) with_coverage=1;;
|
-c|--coverage) with_coverage=1;;
|
||||||
-m|--manage) manage=1;;
|
-m|--manage) manage=1;;
|
||||||
--makemessages) makemessages=1;;
|
--makemessages) makemessages=1;;
|
||||||
--with-selenium) selenium=1;;
|
--only-selenium) only_selenium=1;;
|
||||||
|
--with-selenium) with_selenium=1;;
|
||||||
--docs) just_docs=1;;
|
--docs) just_docs=1;;
|
||||||
--runserver) runserver=1;;
|
--runserver) runserver=1;;
|
||||||
--backup-environment) backup_env=1;;
|
--backup-environment) backup_env=1;;
|
||||||
@ -259,8 +262,11 @@ function install_venv {
|
|||||||
function run_tests {
|
function run_tests {
|
||||||
sanity_check
|
sanity_check
|
||||||
|
|
||||||
if [ $selenium -eq 1 ]; then
|
if [ $with_selenium -eq 1 ]; then
|
||||||
export WITH_SELENIUM=1
|
export WITH_SELENIUM=1
|
||||||
|
elif [ $only_selenium -eq 1 ]; then
|
||||||
|
export WITH_SELENIUM=1
|
||||||
|
export SKIP_UNITTESTS=1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Running Horizon application tests"
|
echo "Running Horizon application tests"
|
||||||
|
Loading…
Reference in New Issue
Block a user