[PATCH 0/4] Reftable test fixes 20211221

STALE1707d

7 messages, 3 authors, 2022-01-10 · open the first message on its own page

[PATCH 0/4] Reftable test fixes 20211221

From: Han-Wen Nienhuys via GitGitGadget <hidden>
Date: 2021-12-22 10:59:48

this is an assorted set of fixes to make some tests pass with reftable.

Han-Wen Nienhuys (4):
  t5540: require REFFILES
  t5550: require REFFILES
  t7004: create separate tags for different tests
  t7004: use "test-tool ref-store" for reflog inspection

 t/t5540-http-push-webdav.sh |  6 ++++++
 t/t5550-http-fetch-dumb.sh  |  7 +++++++
 t/t7004-tag.sh              | 22 +++++++++++-----------
 3 files changed, 24 insertions(+), 11 deletions(-)


base-commit: 69a9c10c95e28df457e33b3c7400b16caf2e2962
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-1168%2Fhanwen%2Freftable-test-fixes-20211221-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-1168/hanwen/reftable-test-fixes-20211221-v1
Pull-Request: https://github.com/git/git/pull/1168
-- 
gitgitgadget

[PATCH 1/4] t5540: require REFFILES

From: Han-Wen Nienhuys via GitGitGadget <hidden>
Date: 2021-12-22 10:59:50

From: Han-Wen Nienhuys <redacted>

The dumb HTTP protocol exposes ref storage details as part of the protocol,
so it only works with the FILES refstorage backend

Signed-off-by: Han-Wen Nienhuys <redacted>
---
 t/t5540-http-push-webdav.sh | 6 ++++++
 1 file changed, 6 insertions(+)
diff --git a/t/t5540-http-push-webdav.sh b/t/t5540-http-push-webdav.sh
index 8b68bb38a44..b0dbacf0b9b 100755
--- a/t/t5540-http-push-webdav.sh
+++ b/t/t5540-http-push-webdav.sh
@@ -18,6 +18,12 @@ then
 	test_done
 fi
 
+if test_have_prereq !REFFILES
+then
+	skip_all='skipping test; dumb HTTP protocol not supported with reftable.'
+	test_done
+fi
+
 LIB_HTTPD_DAV=t
 . "$TEST_DIRECTORY"/lib-httpd.sh
 ROOT_PATH="$PWD"
-- 
gitgitgadget

[PATCH 2/4] t5550: require REFFILES

From: Han-Wen Nienhuys via GitGitGadget <hidden>
Date: 2021-12-22 10:59:53

From: Han-Wen Nienhuys <redacted>

The dumb HTTP protocol exposes ref storage details as part of the protocol,
so it only works with the FILES refstorage backend

Signed-off-by: Han-Wen Nienhuys <redacted>
---
 t/t5550-http-fetch-dumb.sh | 7 +++++++
 1 file changed, 7 insertions(+)
diff --git a/t/t5550-http-fetch-dumb.sh b/t/t5550-http-fetch-dumb.sh
index 6d9142afc3b..259203926a9 100755
--- a/t/t5550-http-fetch-dumb.sh
+++ b/t/t5550-http-fetch-dumb.sh
@@ -5,6 +5,13 @@ GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
+
+if test_have_prereq !REFFILES
+then
+	skip_all='skipping test; dumb HTTP protocol not supported with reftable.'
+	test_done
+fi
+
 . "$TEST_DIRECTORY"/lib-httpd.sh
 start_httpd
 
-- 
gitgitgadget

[PATCH 3/4] t7004: create separate tags for different tests

From: Han-Wen Nienhuys via GitGitGadget <hidden>
Date: 2021-12-22 10:59:54

From: Han-Wen Nienhuys <redacted>

Reftable intentionally keeps reflog data for deleted refs.

This breaks tests that delete and recreate "refs/tags/tag_with_reflog" as traces
of the deletion are left in reflog. To resolve this, use a differently named ref
for each test case.

Signed-off-by: Han-Wen Nienhuys <redacted>
---
 t/t7004-tag.sh | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)
diff --git a/t/t7004-tag.sh b/t/t7004-tag.sh
index 082be85dffc..301d1190482 100755
--- a/t/t7004-tag.sh
+++ b/t/t7004-tag.sh
@@ -94,10 +94,10 @@ test_expect_success 'creating a tag with --create-reflog should create reflog' '
 	git log -1 \
 		--format="format:tag: tagging %h (%s, %cd)%n" \
 		--date=format:%Y-%m-%d >expected &&
-	test_when_finished "git tag -d tag_with_reflog" &&
-	git tag --create-reflog tag_with_reflog &&
-	git reflog exists refs/tags/tag_with_reflog &&
-	sed -e "s/^.*	//" .git/logs/refs/tags/tag_with_reflog >actual &&
+	test_when_finished "git tag -d tag_with_reflog1" &&
+	git tag --create-reflog tag_with_reflog1 &&
+	git reflog exists refs/tags/tag_with_reflog1 &&
+	sed -e "s/^.*	//" .git/logs/refs/tags/tag_with_reflog1 >actual &&
 	test_cmp expected actual
 '
 
@@ -105,10 +105,10 @@ test_expect_success 'annotated tag with --create-reflog has correct message' '
 	git log -1 \
 		--format="format:tag: tagging %h (%s, %cd)%n" \
 		--date=format:%Y-%m-%d >expected &&
-	test_when_finished "git tag -d tag_with_reflog" &&
-	git tag -m "annotated tag" --create-reflog tag_with_reflog &&
-	git reflog exists refs/tags/tag_with_reflog &&
-	sed -e "s/^.*	//" .git/logs/refs/tags/tag_with_reflog >actual &&
+	test_when_finished "git tag -d tag_with_reflog2" &&
+	git tag -m "annotated tag" --create-reflog tag_with_reflog2 &&
+	git reflog exists refs/tags/tag_with_reflog2 &&
+	sed -e "s/^.*	//" .git/logs/refs/tags/tag_with_reflog2 >actual &&
 	test_cmp expected actual
 '
 
@@ -118,10 +118,10 @@ test_expect_success '--create-reflog does not create reflog on failure' '
 '
 
 test_expect_success 'option core.logAllRefUpdates=always creates reflog' '
-	test_when_finished "git tag -d tag_with_reflog" &&
+	test_when_finished "git tag -d tag_with_reflog3" &&
 	test_config core.logAllRefUpdates always &&
-	git tag tag_with_reflog &&
-	git reflog exists refs/tags/tag_with_reflog
+	git tag tag_with_reflog3 &&
+	git reflog exists refs/tags/tag_with_reflog3
 '
 
 test_expect_success 'listing all tags if one exists should succeed' '
-- 
gitgitgadget

[PATCH 4/4] t7004: use "test-tool ref-store" for reflog inspection

From: Han-Wen Nienhuys via GitGitGadget <hidden>
Date: 2021-12-22 10:59:56

From: Han-Wen Nienhuys <redacted>

This makes the test work with reftable.

Signed-off-by: Han-Wen Nienhuys <redacted>
---
 t/t7004-tag.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/t/t7004-tag.sh b/t/t7004-tag.sh
index 301d1190482..bc8a221b2c7 100755
--- a/t/t7004-tag.sh
+++ b/t/t7004-tag.sh
@@ -97,7 +97,7 @@ test_expect_success 'creating a tag with --create-reflog should create reflog' '
 	test_when_finished "git tag -d tag_with_reflog1" &&
 	git tag --create-reflog tag_with_reflog1 &&
 	git reflog exists refs/tags/tag_with_reflog1 &&
-	sed -e "s/^.*	//" .git/logs/refs/tags/tag_with_reflog1 >actual &&
+	test-tool ref-store main for-each-reflog-ent refs/tags/tag_with_reflog1 | sed -e "s/^.*	//" >actual &&
 	test_cmp expected actual
 '
 
@@ -108,7 +108,7 @@ test_expect_success 'annotated tag with --create-reflog has correct message' '
 	test_when_finished "git tag -d tag_with_reflog2" &&
 	git tag -m "annotated tag" --create-reflog tag_with_reflog2 &&
 	git reflog exists refs/tags/tag_with_reflog2 &&
-	sed -e "s/^.*	//" .git/logs/refs/tags/tag_with_reflog2 >actual &&
+	test-tool ref-store main for-each-reflog-ent refs/tags/tag_with_reflog2 | sed -e "s/^.*	//" >actual &&
 	test_cmp expected actual
 '
 
-- 
gitgitgadget

Re: [PATCH 1/4] t5540: require REFFILES

From: Bagas Sanjaya <hidden>
Date: 2021-12-24 05:14:12

On 22/12/21 17.59, Han-Wen Nienhuys via GitGitGadget wrote:
+if test_have_prereq !REFFILES
+then
+	skip_all='skipping test; dumb HTTP protocol not supported with reftable.'
+	test_done
+fi
+
Did you mean reftable doesn't support dumb HTTP protocol or vice versa?

-- 
An old man doll... just what I always wanted! - Clara

Re: [PATCH 1/4] t5540: require REFFILES

From: Han-Wen Nienhuys <hidden>
Date: 2022-01-10 18:29:54

On Fri, Dec 24, 2021 at 6:14 AM Bagas Sanjaya [off-list ref] wrote:
On 22/12/21 17.59, Han-Wen Nienhuys via GitGitGadget wrote:
quoted
+if test_have_prereq !REFFILES
+then
+     skip_all='skipping test; dumb HTTP protocol not supported with reftable.'
+     test_done
+fi
+
Did you mean reftable doesn't support dumb HTTP protocol or vice versa?
AFAIK, the 'dumb protocol' isn't really a protocol, but is simply
exposing the file system over HTTP.

I suppose we could expose the reftable files over HTTP, but that means
we have to rewrite the client to understand reftable files if they are
served. However, I get the impression that nobody really uses the dumb
protocol anymore, so is it worth trying to make this work for
reftable?

-- 
Han-Wen Nienhuys - Google Munich
I work 80%. Don't expect answers from me on Fridays.
--

Google Germany GmbH, Erika-Mann-Strasse 33, 80636 Munich

Registergericht und -nummer: Hamburg, HRB 86891

Sitz der Gesellschaft: Hamburg

Geschäftsführer: Paul Manicle, Halimah DeLaine Prado
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help