diff --git a/setup.cfg b/setup.cfg index db254a7..bf3ce7d 100644 --- a/setup.cfg +++ b/setup.cfg @@ -22,6 +22,8 @@ classifier = [files] packages = oslotest +scripts = + tools/oslo_debug_helper.sh [global] setup-hooks = diff --git a/tools/oslo_debug_helper.sh b/tools/oslo_debug_helper.sh new file mode 100755 index 0000000..f681742 --- /dev/null +++ b/tools/oslo_debug_helper.sh @@ -0,0 +1,30 @@ +#!/bin/bash + +# To utilize this file, add the following to tox.ini: +#[testenv:debug] +#commands = oslo_debug_helper.sh {posargs} + +# To run with tox: +#tox -e debug +#tox -e debug test_notifications +#tox -e debug test_notifications.NotificationsTestCase +#tox -e debug test_notifications.NotificationsTestCase.test_send_notification + +TMP_DIR=`mktemp -d` || exit 1 +trap "rm -rf $TMP_DIR" EXIT + +ALL_TESTS=$TMP_DIR/all_tests +TESTS_TO_RUN=$TMP_DIR/tests_to_run + +PACKAGENAME=$(python setup.py --name) + +python -m testtools.run discover -t ./ ./$PACKAGENAME/tests --list > $ALL_TESTS + +if [ "$1" ]; then + grep "$1" < $ALL_TESTS > $TESTS_TO_RUN +else + mv $ALL_TESTS $TESTS_TO_RUN +fi + +python -m testtools.run discover --load-list $TESTS_TO_RUN +