Skip to content

Commit 7355521

Browse files
committed
Restore ability to run functional tests with run_tests.sh
Change f20b1d4 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
1 parent f89d3fe commit 7355521

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

run_tests.sh

+6
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,12 @@ function run_tests {
130130
set +e
131131
testrargs=`echo "$testrargs" | sed -e's/^\s*\(.*\)\s*$/\1/'`
132132
TESTRTESTS="$TESTRTESTS --testr-args='--subunit $testropts $testrargs'"
133+
OS_TEST_PATH=`echo $testrargs|grep -o 'neutron\.tests[^[:space:]:]*\+'|tr . /`
134+
if [ -d "$OS_TEST_PATH" ]; then
135+
wrapper="OS_TEST_PATH=$OS_TEST_PATH $wrapper"
136+
elif [ -d "$(dirname $OS_TEST_PATH)" ]; then
137+
wrapper="OS_TEST_PATH=$(dirname $OS_TEST_PATH) $wrapper"
138+
fi
133139
echo "Running \`${wrapper} $TESTRTESTS\`"
134140
bash -c "${wrapper} $TESTRTESTS | ${wrapper} subunit2pyunit"
135141
RESULT=$?

0 commit comments

Comments
 (0)