summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Silverstone <daniel.silverstone@codethink.co.uk>2012-09-14 09:33:54 +0100
committerDaniel Silverstone <daniel.silverstone@codethink.co.uk>2012-09-14 17:25:29 +0100
commit154fca16eb20023bdaafc20cb15636c12a33efb1 (patch)
treecf7daf2daa7bd853ff0c721c7360b00e4f2fd975
parente95f04846f5ecc82ce0c7e638756059442de8d23 (diff)
downloadmorph-154fca16eb20023bdaafc20cb15636c12a33efb1.tar.gz
Rework the blackbox tests for bare caches.
This reworks the blackbox tests to work with the bare repository caches. For the most part it's slight changes to error messages and tweaks to ignore the repository caches during file listing.
-rwxr-xr-xtests.branching/branch-creates-new-system-branch-not-from-master.script5
-rwxr-xr-xtests.branching/branch-creates-new-system-branch.script3
-rwxr-xr-xtests.branching/branch-works-anywhere.script12
-rwxr-xr-xtests.branching/checkout-existing-branch.script3
-rwxr-xr-xtests.branching/checkout-non-aliased-repos.script2
-rwxr-xr-xtests.branching/checkout-works-anywhere.script6
-rwxr-xr-xtests.branching/edit-works-after-branch-root-was-renamed.script3
-rwxr-xr-xtests/update-gits-chunk.script2
-rwxr-xr-xtests/update-gits-stratum.script2
9 files changed, 25 insertions, 13 deletions
diff --git a/tests.branching/branch-creates-new-system-branch-not-from-master.script b/tests.branching/branch-creates-new-system-branch-not-from-master.script
index e2883c83..716dce8d 100755
--- a/tests.branching/branch-creates-new-system-branch-not-from-master.script
+++ b/tests.branching/branch-creates-new-system-branch-not-from-master.script
@@ -21,11 +21,12 @@ set -eu
cd "$DATADIR/workspace"
"$SRCDIR/scripts/test-morph" init
-"$SRCDIR/scripts/test-morph" branch baserock:morphs newbranch origin/alfred
+"$SRCDIR/scripts/test-morph" branch baserock:morphs newbranch alfred
echo "File tree:"
"$SRCDIR/scripts/list-tree" . | grep -v '/\.git/' |
- sed 's,/cache/gits/file_[^/]*_,/cache/gits/file_,'
+ sed 's,/cache/gits/file_[^/]*_,/cache/gits/file_,' |
+ grep -v 'cache/gits/file_[^/]*/'
echo "Current branches:"
"$SRCDIR/scripts/run-git-in" newbranch/baserock:morphs branch
diff --git a/tests.branching/branch-creates-new-system-branch.script b/tests.branching/branch-creates-new-system-branch.script
index de1a81ee..86990824 100755
--- a/tests.branching/branch-creates-new-system-branch.script
+++ b/tests.branching/branch-creates-new-system-branch.script
@@ -25,7 +25,8 @@ cd "$DATADIR/workspace"
echo "File tree:"
"$SRCDIR/scripts/list-tree" . | grep -v '/\.git/' |
- sed 's,/cache/gits/file_[^/]*_,/cache/gits/file_,'
+ sed 's,/cache/gits/file_[^/]*_,/cache/gits/file_,' |
+ grep -v 'cache/gits/file_[^/]*/'
echo "Current branches:"
"$SRCDIR/scripts/run-git-in" newbranch/baserock:morphs branch
diff --git a/tests.branching/branch-works-anywhere.script b/tests.branching/branch-works-anywhere.script
index 85098f49..19a00024 100755
--- a/tests.branching/branch-works-anywhere.script
+++ b/tests.branching/branch-works-anywhere.script
@@ -26,14 +26,16 @@ cd "$DATADIR/workspace"
echo "Workspace after creating the first branch:"
"$SRCDIR/scripts/list-tree" "$DATADIR/workspace" | grep -v '/\.git/' |
- sed 's,/cache/gits/file_[^/]*_,/cache/gits/file_,'
+ sed 's,/cache/gits/file_[^/]*_,/cache/gits/file_,' |
+ grep -v 'cache/gits/file_[^/]*/'
# Now, create a nother branch from the workspace.
"$SRCDIR/scripts/test-morph" branch baserock:morphs branch2
echo "Workspace after creating the second branch:"
"$SRCDIR/scripts/list-tree" "$DATADIR/workspace" | grep -v '/\.git/' |
- sed 's,/cache/gits/file_[^/]*_,/cache/gits/file_,'
+ sed 's,/cache/gits/file_[^/]*_,/cache/gits/file_,' |
+ grep -v 'cache/gits/file_[^/]*/'
# Now, enter the first branch and create a third branch, which
# should not be created in the working directory but in the
@@ -43,7 +45,8 @@ cd "$DATADIR/workspace/branch1"
echo "Workspace after creating the third branch:"
"$SRCDIR/scripts/list-tree" "$DATADIR/workspace" | grep -v '/\.git/' |
- sed 's,/cache/gits/file_[^/]*_,/cache/gits/file_,'
+ sed 's,/cache/gits/file_[^/]*_,/cache/gits/file_,' |
+ grep -v 'cache/gits/file_[^/]*/'
# Now, go into the morphs repository of that third branch and
# create a fourth system branch from in there. This, too, should
@@ -53,4 +56,5 @@ cd "$DATADIR/workspace/branch3/baserock:morphs"
echo "Workspace after creating the fourth branch:"
"$SRCDIR/scripts/list-tree" "$DATADIR/workspace" | grep -v '/\.git/' |
- sed 's,/cache/gits/file_[^/]*_,/cache/gits/file_,'
+ sed 's,/cache/gits/file_[^/]*_,/cache/gits/file_,' |
+ grep -v 'cache/gits/file_[^/]*/'
diff --git a/tests.branching/checkout-existing-branch.script b/tests.branching/checkout-existing-branch.script
index e7e3a379..0edf0222 100755
--- a/tests.branching/checkout-existing-branch.script
+++ b/tests.branching/checkout-existing-branch.script
@@ -27,7 +27,8 @@ cd "$DATADIR/workspace"
echo "File tree:"
"$SRCDIR/scripts/list-tree" . | grep -v '/\.git/' |
- sed 's,/cache/gits/file_[^/]*_,/cache/gits/file_,'
+ sed 's,/cache/gits/file_[^/]*_,/cache/gits/file_,' |
+ grep -v 'cache/gits/file_[^/]*/'
echo "Current branches:"
"$SRCDIR/scripts/run-git-in" master/baserock:morphs branch
diff --git a/tests.branching/checkout-non-aliased-repos.script b/tests.branching/checkout-non-aliased-repos.script
index 6c9ac638..75b68bea 100755
--- a/tests.branching/checkout-non-aliased-repos.script
+++ b/tests.branching/checkout-non-aliased-repos.script
@@ -37,6 +37,7 @@ cd "$DATADIR/workspace"
echo "File tree of repo with suffix:"
"$SRCDIR/scripts/list-tree" . | grep -v '/\.git/' |
sed 's,/cache/gits/file_[^/]*_,/cache/gits/file_,' |
+ grep -v 'cache/gits/file_[^/]*/' |
sed "s,${DATADIR:1},DATADIR,g" |
sed "s,${TEMP_DIR:1},TEMP_DIR,g"
@@ -54,6 +55,7 @@ cd "$DATADIR/workspace"
echo "File tree of repo without suffix:"
"$SRCDIR/scripts/list-tree" . | grep -v '/\.git/' |
sed 's,/cache/gits/file_[^/]*_,/cache/gits/file_,' |
+ grep -v 'cache/gits/file_[^/]*/' |
sed "s,${DATADIR:1},DATADIR,g" |
sed "s,${TEMP_DIR:1},TEMP_DIR,g"
diff --git a/tests.branching/checkout-works-anywhere.script b/tests.branching/checkout-works-anywhere.script
index fdc3c955..73e30498 100755
--- a/tests.branching/checkout-works-anywhere.script
+++ b/tests.branching/checkout-works-anywhere.script
@@ -26,7 +26,8 @@ cd "$DATADIR/workspace"
echo "Workspace after checking out master from the workspace directory:"
"$SRCDIR/scripts/list-tree" "$DATADIR/workspace" | grep -v '/\.git/' |
- sed 's,/cache/gits/file_[^/]*_,/cache/gits/file_,'
+ sed 's,/cache/gits/file_[^/]*_,/cache/gits/file_,' |
+ grep -v 'cache/gits/file_[^/]*/'
# Reset the workspace.
cd "$DATADIR"
@@ -43,4 +44,5 @@ cd newbranch/baserock:morphs
echo "Workspace after checking out master from within a new branch:"
"$SRCDIR/scripts/list-tree" "$DATADIR/workspace" | grep -v '/\.git/' |
- sed 's,/cache/gits/file_[^/]*_,/cache/gits/file_,'
+ sed 's,/cache/gits/file_[^/]*_,/cache/gits/file_,' |
+ grep -v 'cache/gits/file_[^/]*/'
diff --git a/tests.branching/edit-works-after-branch-root-was-renamed.script b/tests.branching/edit-works-after-branch-root-was-renamed.script
index 191300e6..2f0d1588 100755
--- a/tests.branching/edit-works-after-branch-root-was-renamed.script
+++ b/tests.branching/edit-works-after-branch-root-was-renamed.script
@@ -31,4 +31,5 @@ mv baserock:morphs my-renamed-morphs
"$SRCDIR/scripts/test-morph" edit hello-system hello-stratum hello
"$SRCDIR/scripts/list-tree" "$DATADIR/workspace" | grep -v '/\.git/' |
- sed 's,/cache/gits/file_[^/]*_,/cache/gits/file_,'
+ sed 's,/cache/gits/file_[^/]*_,/cache/gits/file_,' |
+ grep -v 'cache/gits/file_[^/]*/'
diff --git a/tests/update-gits-chunk.script b/tests/update-gits-chunk.script
index b07aef17..54a8d9ed 100755
--- a/tests/update-gits-chunk.script
+++ b/tests/update-gits-chunk.script
@@ -30,4 +30,4 @@ NEWREF="$(git show-ref --hash farrokh)"
# check the top commit of the cached repo's farrokh branch
cd "$DATADIR/cache/gits/"*chunk?repo*
-test "$(git show-ref --hash refs/remotes/origin/farrokh)" = "$NEWREF"
+test "$(git show-ref --hash refs/heads/farrokh)" = "$NEWREF"
diff --git a/tests/update-gits-stratum.script b/tests/update-gits-stratum.script
index 24b6f199..718f2547 100755
--- a/tests/update-gits-stratum.script
+++ b/tests/update-gits-stratum.script
@@ -30,4 +30,4 @@ NEWREF="$(git show-ref --hash farrokh)"
# check the top commit of the cached repo's farrokh branch
cd "$DATADIR/cache/gits/"*chunk?repo*
-test "$(git show-ref --hash refs/remotes/origin/farrokh)" = "$NEWREF"
+test "$(git show-ref --hash refs/heads/farrokh)" = "$NEWREF"