aboutsummaryrefslogtreecommitdiffstats
path: root/test_upgrade.py
diff options
context:
space:
mode:
authorW. Trevor King <wking@drexel.edu>2009-12-27 15:58:29 -0500
committerW. Trevor King <wking@drexel.edu>2009-12-27 15:58:29 -0500
commit214c4317bb90684dcfdab4d2402daa66fbad2e77 (patch)
tree8935072ad4ce8ddee2a7056412a7a89c96acf359 /test_upgrade.py
parent89b7a1411e4658e831f5d635534b24355dbb941d (diff)
downloadbugseverywhere-214c4317bb90684dcfdab4d2402daa66fbad2e77.tar.gz
Fixed libbe.storage.util.upgrade
Note that it only upgrades on-disk versions, so you can't use a non-VCS storage backend whose version isn't your command's current storage version. See #bea/110/bd1# for reasoning. To see the on-disk storage version, look at .be/version To see your command's supported storage version, look at be --full-version I added test_upgrade.sh to exercise the upgrade mechanism on BE's own repository.
Diffstat (limited to 'test_upgrade.py')
-rwxr-xr-xtest_upgrade.py33
1 files changed, 33 insertions, 0 deletions
diff --git a/test_upgrade.py b/test_upgrade.py
new file mode 100755
index 0000000..40db42a
--- /dev/null
+++ b/test_upgrade.py
@@ -0,0 +1,33 @@
+#!/bin/bash
+#
+# Test upgrade functionality by checking out revisions with the
+# various initial on-disk versions and running `be list` on them to
+# force an auto-upgrade.
+#
+# usage: test_upgrade.sh
+
+REVS='revid:wking@drexel.edu-20090831063121-85p59rpwoi1mzk3i
+revid:wking@drexel.edu-20090831171945-73z3wwt4lrm7zbmu
+revid:wking@drexel.edu-20091205224008-z4fed13sd80bj4fe
+revid:wking@drexel.edu-20091207123614-okq7i0ahciaupuy9'
+
+ROOT=$(bzr root)
+BE="$ROOT/be"
+cd "$ROOT"
+
+echo "$REVS" | while read REV; do
+ TMPDIR=$(mktemp --directory --tmpdir "BE-upgrade.XXXXXXXXXX")
+ REPO="$TMPDIR/repo"
+ echo "Testing revision: $REV"
+ echo " Test directory: $REPO"
+ bzr checkout --lightweight --revision="$REV" "$ROOT" "$TMPDIR/repo"
+ VERSION=$(cat "$REPO/.be/version")
+ echo " Version: $VERSION"
+ $BE --repo "$REPO" list > /dev/null
+ RET="$?"
+ rm -rf "$TMPDIR"
+ if [ $RET -ne 0 ]; then
+ echo "Error! ($RET)"
+ exit $RET
+ fi
+done