Subject: Re: [PATCH v2 43/43] refs: tests for db backend

From: Dennis Kaarsemaker <[email-masked]>
Date: Sat, 3 Oct 2015 19:39:31 +0200

On Mon, Sep 28, 2015 at 06:02:18PM -0400, David Turner wrote:
> Add tests for the database backend.
> 
> Signed-off-by: David Turner <[email-masked]>
> ---
>  t/t1460-refs-be-db.sh        | 1103 ++++++++++++++++++++++++++++++++++++++++++
>  t/t1470-refs-be-db-reflog.sh |  353 ++++++++++++++
>  2 files changed, 1456 insertions(+)
>  create mode 100755 t/t1460-refs-be-db.sh
>  create mode 100755 t/t1470-refs-be-db-reflog.sh

These break 'make test' on builds without the db backend. Maybe squash
in something like the following:

diff --git a/t/t1460-refs-be-db.sh b/t/t1460-refs-be-db.sh
index f13b0f0..c8222ed 100755
--- a/t/t1460-refs-be-db.sh
+++ b/t/t1460-refs-be-db.sh
@@ -9,6 +9,11 @@ test_description='Test lmdb refs backend'
 TEST_NO_CREATE_REPO=1
 . ./test-lib.sh
 
+if ! test -e ../../test-refs-be-lmdb; then
+	skip_all="Skipping lmdb refs backend tests, lmdb backend not built"
+	test_done
+fi
+
 raw_ref() {
 	test-refs-be-lmdb "$1"
 }
diff --git a/t/t1470-refs-be-db-reflog.sh b/t/t1470-refs-be-db-reflog.sh
index 99a705d..2538a58 100755
--- a/t/t1470-refs-be-db-reflog.sh
+++ b/t/t1470-refs-be-db-reflog.sh
@@ -8,6 +8,11 @@ test_description='Test prune and reflog expiration'
 TEST_NO_CREATE_REPO=1
 . ./test-lib.sh
 
+if ! test -e ../../test-refs-be-lmdb; then
+	skip_all="Skipping lmdb refs backend tests, lmdb backend not built"
+	test_done
+fi
+
 raw_reflog() {
 	cat .git/logs/$1 2>/dev/null || test-refs-be-lmdb -l "$1"
 }

Also, test 18 in t1460 is broken:
expecting success: 
    git symbolic-ref refs/heads/self refs/heads/self &&
        test_when_finished "delete_ref refs/heads/self" &&
            test_must_fail git update-ref -d refs/heads/self

test_must_fail: command succeeded: git update-ref -d refs/heads/self
not ok 18 - update-ref -d is not confused by self-reference
#   
#       git symbolic-ref refs/heads/self refs/heads/self &&
#       test_when_finished "delete_ref refs/heads/self" &&
#       test_must_fail git update-ref -d refs/heads/self
#   

-- 
Dennis Kaarsemaker <[email-masked]>
http://twitter.com/seveas