]> scripts.mit.edu Git - wizard.git/commitdiff
tests/all-versions.sh runs all tests for all versions of the specified app.
authorIan Smith <ismith@MIT.EDU>
Tue, 29 Dec 2009 23:52:25 +0000 (17:52 -0600)
committerEdward Z. Yang <ezyang@mit.edu>
Wed, 30 Dec 2009 03:23:50 +0000 (22:23 -0500)
Signed-off-by: Ian Smith <ismith@mit.edu>
tests/all-tests.sh [moved from tests/all.sh with 51% similarity]
tests/all-versions.sh [new file with mode: 0755]
wizard/command/upgrade.py

similarity index 51%
rename from tests/all.sh
rename to tests/all-tests.sh
index 964e559e61937605e2cf9388728dc2fa2e4a532b..66d7fa5ea12176e6351adac6ff8efc88aa10c44b 100755 (executable)
@@ -1,18 +1,22 @@
 #!/bin/bash
+# takes an app name and a version as arguments
 cd `dirname $0`
 bold="`tput -T${TERM:-dumb} bold`"
 red="`tput -T${TERM:-dumb} setf 4`"
+green="`tput -T${TERM:-dumb} setf 2`"
 sgr0="`tput -T${TERM:-dumb} sgr0`"
 APP="$1"
 if [ "$APP" == "" ]; then
-    echo "Must specify application"
+    echo "Must specify application and version"
     exit 1
 fi
 for i in $1-*-test.sh; do
     ./$i "$2"
-    if [ $? -eq 0 ]
+
+    if [ $? -eq 0 ] || [ $? -eq 2 ];
     then
-        echo "${bold}OK${sgr0}"
+        echo "${bold}${green}OK${sgr0}"
+        wizard remove "testdir_$(echo "${i%-test.sh}" | tr - _)_$2"
     else
         echo "${bold}${red}FAIL${sgr0}"
     fi
diff --git a/tests/all-versions.sh b/tests/all-versions.sh
new file mode 100755 (executable)
index 0000000..86dc4ae
--- /dev/null
@@ -0,0 +1,21 @@
+#!/bin/bash
+# takes an app name, and the git repo where it is located as arguments
+cd `dirname $0`
+bold="`tput -T${TERM:-dumb} bold`"
+red="`tput -T${TERM:-dumb} setf 4`"
+green="`tput -T${TERM:-dumb} setf 2`"
+sgr0="`tput -T${TERM:-dumb} sgr0`"
+APP="$1"
+REPO="$2"
+if [ "$APP" == "" ]; then
+    echo "Must specify application"
+    exit 1
+fi
+if [ "$REPO" == "" ]; then
+    echo "Must specify path to git repo"
+    exit 1
+fi
+
+for version in `git --git-dir=$REPO tag | grep scripts | sed -e 's/.*-\(.*\)-.*/\1/'`; do
+    ./all-tests.sh $APP $version
+done
index a8cbde76e67b778d3637d9370099fb1b4ec3439d..475ddd700660abb72773219d5fb3fe82f642ef18 100644 (file)
@@ -177,7 +177,7 @@ class Upgrade(object):
             # XXX: maybe we should build this in as a flag to add
             # to exceptions w/ our exception handler
             sys.stderr.write("Traceback:\n  (n/a)\nAlreadyUpgraded\n")
-            sys.exit(1)
+            sys.exit(2)
     def preflightQuota(self):
         kib_usage, kib_limit = scripts.get_quota_usage_and_limit()
         if kib_limit is not None and (kib_limit - kib_usage) < kib_buffer: