summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorgordon chung <gord@live.ca>2014-07-30 12:02:17 -0400
committergordon chung <gord@live.ca>2014-07-31 15:11:11 -0400
commit2dc6348c90f3dcf92e1e31e90b23d5fd593da6b0 (patch)
treeaa3537e52c02ab8c01eb9be417eddb156274a1f0 /tools
parentc638d043b1845c1c6e7b0e8b50f921494d9cdf5c (diff)
downloadceilometer-2dc6348c90f3dcf92e1e31e90b23d5fd593da6b0.tar.gz
Debug env for tox
Running a test with pdb was difficult because tox captures output and causes pdb prompt to quit. Tips for how to run with debug are provided here: https://wiki.openstack.org/wiki/Testr#Debugging_.28pdb.29_Tests This change puts these commands into a debug env in tox.ini so you can do a command like: tox -e debug pycadf.tests.test_cadf_spec and when it hits your breakpoint you'll get the debug prompt. Change-Id: Ic53a888e4e305d51159d1d6a2f962786a532e089 Co-Authored-By: Brant Knudson <bknudson@us.ibm.com> Closes-Bug: #1350424
Diffstat (limited to 'tools')
-rwxr-xr-xtools/debug_helper.sh17
1 files changed, 17 insertions, 0 deletions
diff --git a/tools/debug_helper.sh b/tools/debug_helper.sh
new file mode 100755
index 00000000..195aff9e
--- /dev/null
+++ b/tools/debug_helper.sh
@@ -0,0 +1,17 @@
+#!/bin/bash
+
+TMP_DIR=`mktemp -d` || exit 1
+trap "rm -rf $TMP_DIR" EXIT
+
+ALL_TESTS=$TMP_DIR/all_tests
+TESTS_TO_RUN=$TMP_DIR/ks_to_run
+
+python -m testtools.run discover -t ./ ./ceilometer/tests --list > $ALL_TESTS
+
+if [ "$1" ]; then
+ grep "$1" < $ALL_TESTS > $TESTS_TO_RUN
+else
+ mv $ALL_TESTS $TESTS_TO_RUN
+fi
+
+STANDARD_THREADS=1 python -m testtools.run discover --load-list $TESTS_TO_RUN