From: Terry Wilson Date: Wed, 16 Apr 2014 20:23:40 +0000 (-0400) Subject: Restore ability to run functional tests with run_tests.sh X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=7355521a50e16099ce8cd7a20f451f85ae007b6b;p=openstack-build%2Fneutron-build.git 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 --- diff --git a/run_tests.sh b/run_tests.sh index 4d838e8aa..8f0dbd3d7 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=$?