From 7355521a50e16099ce8cd7a20f451f85ae007b6b Mon Sep 17 00:00:00 2001 From: Terry Wilson Date: Wed, 16 Apr 2014 16:23:40 -0400 Subject: [PATCH] Restore ability to run functional tests with run_tests.sh Change f20b1d42 which split the running of functional tests from the running of unit tests caused running: ./run_tests.sh neutron.tests.functional to fail as the OS_TEST_PATH variable will be defaulted to neutron.tests.unit which means that the functional tests will not be discovered in the above case. This patch trys to detect an argument passed in the form of a neutron.tests string and correctly sets the OS_TEST_PATH variable based on it. Change-Id: I8ccdc7f10d3c8478281aeaf8d02175d0eeb8d6e9 --- run_tests.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/run_tests.sh b/run_tests.sh index 4d838e8aa9d..8f0dbd3d7d4 100755 --- a/run_tests.sh +++ b/run_tests.sh @@ -130,6 +130,12 @@ function run_tests { set +e testrargs=`echo "$testrargs" | sed -e's/^\s*\(.*\)\s*$/\1/'` TESTRTESTS="$TESTRTESTS --testr-args='--subunit $testropts $testrargs'" + OS_TEST_PATH=`echo $testrargs|grep -o 'neutron\.tests[^[:space:]:]*\+'|tr . /` + if [ -d "$OS_TEST_PATH" ]; then + wrapper="OS_TEST_PATH=$OS_TEST_PATH $wrapper" + elif [ -d "$(dirname $OS_TEST_PATH)" ]; then + wrapper="OS_TEST_PATH=$(dirname $OS_TEST_PATH) $wrapper" + fi echo "Running \`${wrapper} $TESTRTESTS\`" bash -c "${wrapper} $TESTRTESTS | ${wrapper} subunit2pyunit" RESULT=$?