From: "John Cai via GitGitGadget" <gitgitgadget@gmail.com>
To: git@vger.kernel.org
Cc: John Cai <johncai86@gmail.com>, John Cai <johncai86@gmail.com>
Subject: [PATCH 07/12] t1410: move reffiles specific tests to t0600
Date: Wed, 17 Jan 2024 19:52:30 +0000 [thread overview]
Message-ID: <ae71747871cf97e8f0fb802836e0e5c7ae961696.1705521155.git.gitgitgadget@gmail.com> (raw)
In-Reply-To: <pull.1647.git.git.1705521155.gitgitgadget@gmail.com>
From: John Cai <johncai86@gmail.com>
Move these tests to t0600 with other reffiles specific tests since they
do things like take a lock on an individual ref, and write directly into
the reflog refs
Signed-off-by: John Cai <johncai86@gmail.com>
---
t/t0600-reffiles-backend.sh | 51 +++++++++++++++++++++++++++++++++++++
t/t1410-reflog.sh | 42 ------------------------------
2 files changed, 51 insertions(+), 42 deletions(-)
diff --git a/t/t0600-reffiles-backend.sh b/t/t0600-reffiles-backend.sh
index 09fbe312092..0b28a2cc5ea 100755
--- a/t/t0600-reffiles-backend.sh
+++ b/t/t0600-reffiles-backend.sh
@@ -451,4 +451,55 @@ test_expect_success 'for_each_reflog()' '
test_cmp expected actual
'
+# Triggering the bug detected by this test requires a newline to fall
+# exactly BUFSIZ-1 bytes from the end of the file. We don't know
+# what that value is, since it's platform dependent. However, if
+# we choose some value N, we also catch any D which divides N evenly
+# (since we will read backwards in chunks of D). So we choose 8K,
+# which catches glibc (with an 8K BUFSIZ) and *BSD (1K).
+#
+# Each line is 114 characters, so we need 75 to still have a few before the
+# last 8K. The 89-character padding on the final entry lines up our
+# newline exactly.
+test_expect_success SHA1 'parsing reverse reflogs at BUFSIZ boundaries' '
+ git checkout -b reflogskip &&
+ zf=$(test_oid zero_2) &&
+ ident="abc <xyz> 0000000001 +0000" &&
+ for i in $(test_seq 1 75); do
+ printf "$zf%02d $zf%02d %s\t" $i $(($i+1)) "$ident" &&
+ if test $i = 75; then
+ for j in $(test_seq 1 89); do
+ printf X || return 1
+ done
+ else
+ printf X
+ fi &&
+ printf "\n" || return 1
+ done >.git/logs/refs/heads/reflogskip &&
+ git rev-parse reflogskip@{73} >actual &&
+ echo ${zf}03 >expect &&
+ test_cmp expect actual
+'
+
+# This test takes a lock on an individual ref; this is not supported in
+# reftable.
+test_expect_success 'reflog expire operates on symref not referrent' '
+ git branch --create-reflog the_symref &&
+ git branch --create-reflog referrent &&
+ git update-ref referrent HEAD &&
+ git symbolic-ref refs/heads/the_symref refs/heads/referrent &&
+ test_when_finished "rm -f .git/refs/heads/referrent.lock" &&
+ touch .git/refs/heads/referrent.lock &&
+ git reflog expire --expire=all the_symref
+'
+
+test_expect_success 'empty reflog' '
+ test_when_finished "rm -rf empty" &&
+ git init empty &&
+ test_commit -C empty A &&
+ >empty/.git/logs/refs/heads/foo &&
+ git -C empty reflog expire --all 2>err &&
+ test_must_be_empty err
+'
+
test_done
diff --git a/t/t1410-reflog.sh b/t/t1410-reflog.sh
index a0ff8d51f04..d2f5f42e674 100755
--- a/t/t1410-reflog.sh
+++ b/t/t1410-reflog.sh
@@ -354,36 +354,6 @@ test_expect_success 'stale dirs do not cause d/f conflicts (reflogs off)' '
test_must_be_empty actual
'
-# Triggering the bug detected by this test requires a newline to fall
-# exactly BUFSIZ-1 bytes from the end of the file. We don't know
-# what that value is, since it's platform dependent. However, if
-# we choose some value N, we also catch any D which divides N evenly
-# (since we will read backwards in chunks of D). So we choose 8K,
-# which catches glibc (with an 8K BUFSIZ) and *BSD (1K).
-#
-# Each line is 114 characters, so we need 75 to still have a few before the
-# last 8K. The 89-character padding on the final entry lines up our
-# newline exactly.
-test_expect_success REFFILES,SHA1 'parsing reverse reflogs at BUFSIZ boundaries' '
- git checkout -b reflogskip &&
- zf=$(test_oid zero_2) &&
- ident="abc <xyz> 0000000001 +0000" &&
- for i in $(test_seq 1 75); do
- printf "$zf%02d $zf%02d %s\t" $i $(($i+1)) "$ident" &&
- if test $i = 75; then
- for j in $(test_seq 1 89); do
- printf X || return 1
- done
- else
- printf X
- fi &&
- printf "\n" || return 1
- done >.git/logs/refs/heads/reflogskip &&
- git rev-parse reflogskip@{73} >actual &&
- echo ${zf}03 >expect &&
- test_cmp expect actual
-'
-
test_expect_success 'no segfaults for reflog containing non-commit sha1s' '
git update-ref --create-reflog -m "Creating ref" \
refs/tests/tree-in-reflog HEAD &&
@@ -397,18 +367,6 @@ test_expect_failure 'reflog with non-commit entries displays all entries' '
test_line_count = 3 actual
'
-# This test takes a lock on an individual ref; this is not supported in
-# reftable.
-test_expect_success REFFILES 'reflog expire operates on symref not referrent' '
- git branch --create-reflog the_symref &&
- git branch --create-reflog referrent &&
- git update-ref referrent HEAD &&
- git symbolic-ref refs/heads/the_symref refs/heads/referrent &&
- test_when_finished "rm -f .git/refs/heads/referrent.lock" &&
- touch .git/refs/heads/referrent.lock &&
- git reflog expire --expire=all the_symref
-'
-
test_expect_success 'continue walking past root commits' '
git init orphanage &&
(
--
gitgitgadget
next prev parent reply other threads:[~2024-01-17 19:53 UTC|newest]
Thread overview: 47+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-17 19:52 [PATCH 00/12] Group reffiles tests John Cai via GitGitGadget
2024-01-17 19:52 ` [PATCH 01/12] t3210: move to t0602 John Cai via GitGitGadget
2024-01-18 0:40 ` Junio C Hamano
2024-01-18 11:32 ` Patrick Steinhardt
2024-01-18 16:25 ` John Cai
2024-01-17 19:52 ` [PATCH 02/12] remove REFFILES prerequisite John Cai via GitGitGadget
2024-01-18 0:46 ` Junio C Hamano
2024-01-18 11:21 ` Patrick Steinhardt
2024-01-17 19:52 ` [PATCH 03/12] t1414: convert test to use Git commands instead of writing refs manually John Cai via GitGitGadget
2024-01-18 0:56 ` Junio C Hamano
2024-01-17 19:52 ` [PATCH 04/12] t1404: move reffiles specific tests to t0600 John Cai via GitGitGadget
2024-01-19 13:27 ` Patrick Steinhardt
2024-01-17 19:52 ` [PATCH 05/12] t1405: " John Cai via GitGitGadget
2024-01-17 19:52 ` [PATCH 06/12] t1406: " John Cai via GitGitGadget
2024-01-17 19:52 ` John Cai via GitGitGadget [this message]
2024-01-17 19:52 ` [PATCH 08/12] t1415: " John Cai via GitGitGadget
2024-01-19 13:29 ` Patrick Steinhardt
2024-01-17 19:52 ` [PATCH 09/12] t1503: " John Cai via GitGitGadget
2024-01-17 19:52 ` [PATCH 10/12] t3903: " John Cai via GitGitGadget
2024-01-19 13:39 ` Patrick Steinhardt
2024-01-19 15:47 ` John Cai
2024-01-17 19:52 ` [PATCH 11/12] t4202: " John Cai via GitGitGadget
2024-01-17 19:52 ` [PATCH 12/12] t5312: " John Cai via GitGitGadget
2024-01-19 13:40 ` Patrick Steinhardt
2024-01-18 1:17 ` [PATCH 00/12] Group reffiles tests Junio C Hamano
2024-01-18 11:38 ` Patrick Steinhardt
2024-01-18 20:00 ` Junio C Hamano
2024-01-19 20:18 ` [PATCH v2 " John Cai via GitGitGadget
2024-01-19 20:18 ` [PATCH v2 01/12] t3210: move to t0601 John Cai via GitGitGadget
2024-01-22 11:31 ` Patrick Steinhardt
2024-01-19 20:18 ` [PATCH v2 02/12] remove REFFILES prerequisite for some tests in t1405 and t2017 John Cai via GitGitGadget
2024-01-19 20:18 ` [PATCH v2 03/12] t1414: convert test to use Git commands instead of writing refs manually John Cai via GitGitGadget
2024-01-19 20:18 ` [PATCH v2 04/12] t1404: move reffiles specific tests to t0600 John Cai via GitGitGadget
2024-01-22 11:31 ` Patrick Steinhardt
2024-01-19 20:18 ` [PATCH v2 05/12] t1405: move reffiles specific tests to t0601 John Cai via GitGitGadget
2024-01-19 20:18 ` [PATCH v2 06/12] t1406: move reffiles specific tests to t0600 John Cai via GitGitGadget
2024-01-19 20:18 ` [PATCH v2 07/12] t1410: " John Cai via GitGitGadget
2024-01-22 14:12 ` Karthik Nayak
2024-01-19 20:18 ` [PATCH v2 08/12] t1415: move reffiles specific tests to t0601 John Cai via GitGitGadget
2024-01-22 14:12 ` Karthik Nayak
2024-01-19 20:18 ` [PATCH v2 09/12] t1503: move reffiles specific tests to t0600 John Cai via GitGitGadget
2024-01-19 20:18 ` [PATCH v2 10/12] t3903: make drop stash test ref backend agnostic John Cai via GitGitGadget
2024-01-19 20:18 ` [PATCH v2 11/12] t4202: move reffiles specific tests to t0600 John Cai via GitGitGadget
2024-01-19 20:19 ` [PATCH v2 12/12] t5312: move reffiles specific tests to t0601 John Cai via GitGitGadget
2024-01-22 11:36 ` [PATCH v2 00/12] Group reffiles tests Patrick Steinhardt
2024-01-23 0:01 ` Junio C Hamano
2024-01-24 21:37 ` John Cai
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ae71747871cf97e8f0fb802836e0e5c7ae961696.1705521155.git.gitgitgadget@gmail.com \
--to=gitgitgadget@gmail.com \
--cc=git@vger.kernel.org \
--cc=johncai86@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).