Merge lp:~clint-fewbar/pyjuju/add-testrunner into lp:pyjuju
Proposed by
Clint Byrum
Status: | Needs review | ||||
---|---|---|---|---|---|
Proposed branch: | lp:~clint-fewbar/pyjuju/add-testrunner | ||||
Merge into: | lp:pyjuju | ||||
Diff against target: |
29 lines (+25/-0) 1 file modified
misc/devel-tools/test-watcher (+25/-0) |
||||
To merge this branch: | bzr merge lp:~clint-fewbar/pyjuju/add-testrunner | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Juju Engineering | Pending | ||
Review via email: mp+128356@code.launchpad.net |
Description of the change
Add a tool to run tests automatically on change
While developing, its quite helpful to have relevant tests run automatically on
any changes. The script proposed here will do exactly that, using iwatch
(so it will only work on Linux systems).
To post a comment you must log in.
Unmerged revisions
- 593. By Clint Byrum
-
adding helper tool to run tests on changes of .py files
Reviewers: mp+128356_ code.launchpad. net,
Message:
Please take a look.
Description:
Add a tool to run tests automatically on change
While developing, its quite helpful to have relevant run automatically
on
any changes. The script proposed here will do exactly that, using iwatch
(so it will only work on Linux systems).
https:/ /code.launchpad .net/~clint- fewbar/ juju/add- testrunner/ +merge/ 128356
(do not edit description out of merge proposal)
Please review this at https:/ /codereview. appspot. com/6624055/
Affected files: tools/test- watcher
A [revision details]
A misc/devel-
Index: [revision details]
=== added file '[revision details]'
--- [revision details] 2012-01-01 00:00:00 +0000
+++ [revision details] 2012-01-01 00:00:00 +0000
@@ -0,0 +1,2 @@
+Old revision: <email address hidden>
+New revision: <email address hidden>
Index: misc/devel- tools/test- watcher tools/test- watcher' tools/test- watcher 1970-01-01 00:00:00 +0000 tools/test- watcher 2012-10-06 15:46:21 +0000 ${file/ /\//.} ${testmod% %.py} ${dir// \//.} ${testmod# #..}
=== added file 'misc/devel-
--- misc/devel-
+++ misc/devel-
@@ -0,0 +1,25 @@
+#!/bin/bash
+# Author: Clint Byrum <email address hidden>
+# Run this script in a window and it will continuously monitor the
+# files in the current directory, and run the tests associated with
+# a change whenever they are written. It will also use notify-send
+# to let you know if tests passed or failed.
+#
+if [ -z "$1" ] ; then
+ exec iwatch -r -t .*\.py$ -c "$0 %f" -x .bzr -e modify -v .
+fi
+file=$1
+dir=`dirname $file`
+if [ "`basename $dir`" = "tests" ] ; then
+ testmod=
+ testmod=
+else
+ testmod=
+fi
+testmod=
+echo $file changed, Running tests ... $testmod
+if eatmydata ./test $testmod ; then
+ exec notify-send -i terminal "$testmod PASSED"
+else
+ exec notify-send -u critical -i terminal "$testmod FAILED"
+fi