From 157eaf8ffa536aabbd7bdc81310188348be925f5 Mon Sep 17 00:00:00 2001 From: Matthew Treinish Date: Thu, 11 Sep 2014 16:27:52 -0400 Subject: [PATCH] Switch to running tests in parallel with testr This commits switches the test runner in the functional tests to use testr in parallel instead of nosetests. There are a few reasons for doing this, firstly parallel testing ensures performs the functional testing in a more realistic environment. Secondly, tempest which these tests are based on doesn't support using nose, so to prevent any potential issues we should use the same test runner here. Lastly, in the future subunit output will be used to perform additionally analysis on test runs. So if the same methods were to be used on the functional tests they need to produce subunit streams from the test runs. Change-Id: I7daf2be58c44f2555861e47d3444523d75cc4e28 --- functionaltests/.testr.conf | 5 +++++ functionaltests/run_tests.sh | 6 +++++- 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 functionaltests/.testr.conf diff --git a/functionaltests/.testr.conf b/functionaltests/.testr.conf new file mode 100644 index 000000000..014a17095 --- /dev/null +++ b/functionaltests/.testr.conf @@ -0,0 +1,5 @@ +[DEFAULT] +test_command=${PYTHON:-python} -m subunit.run discover -s ./api -t . $LISTOPT $IDOPTION + +test_id_option=--load-list $IDFILE +test_list_option=--list diff --git a/functionaltests/run_tests.sh b/functionaltests/run_tests.sh index 6f5e93563..a6dbadaf4 100755 --- a/functionaltests/run_tests.sh +++ b/functionaltests/run_tests.sh @@ -35,4 +35,8 @@ TEMPEST_DIR=${TEMPEST_DIR:-/opt/stack/new/tempest} # Install tempest pip install -e $TEMPEST_DIR -nosetests -v . +testr init +testr run --parallel --subunit | $TEMPEST_DIR/tools/subunit-trace.py --no-failure-debug -f +retval=$? +testr slowest +exit $retval