From: Patrick Steinhardt <ps@pks.im>
To: Taylor Blau <me@ttaylorr.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH 1/6] t1300: mark tests to require default repo format
Date: Wed, 10 Jan 2024 08:15:18 +0100 [thread overview]
Message-ID: <ZZ5EBojTbQ4pyGx-@tanuki> (raw)
In-Reply-To: <ZZ2TdYlcrLN9zckR@nand.local>
[-- Attachment #1: Type: text/plain, Size: 3303 bytes --]
On Tue, Jan 09, 2024 at 01:41:57PM -0500, Taylor Blau wrote:
> On Tue, Jan 09, 2024 at 01:17:04PM +0100, Patrick Steinhardt wrote:
> > The t1300 test suite exercises the git-config(1) tool. To do so we
> > overwrite ".git/config" to contain custom contents. While this is easy
> > enough to do, it may create problems when using a non-default repository
> > format because we also overwrite the repository format version as well
> > as any potential extensions.
> >
> > Mark these tests with the DEFAULT_REPO_FORMAT prerequisite to avoid the
> > problem. An alternative would be to carry over mandatory config keys
> > into the rewritten config file. But the effort does not seem worth it
> > given that the system under test is git-config(1), which is at a lower
> > level than the repository format.
>
> I think I am missing something obvious here ;-).
>
> > Signed-off-by: Patrick Steinhardt <ps@pks.im>
> > ---
> > t/t1300-config.sh | 8 ++++----
> > 1 file changed, 4 insertions(+), 4 deletions(-)
> >
> > diff --git a/t/t1300-config.sh b/t/t1300-config.sh
> > index f4e2752134..1e953a0fc2 100755
> > --- a/t/t1300-config.sh
> > +++ b/t/t1300-config.sh
> > @@ -1098,7 +1098,7 @@ test_expect_success SYMLINKS 'symlink to nonexistent configuration' '
> > test_must_fail git config --file=linktolinktonada --list
> > '
> >
> > -test_expect_success 'check split_cmdline return' "
> > +test_expect_success DEFAULT_REPO_FORMAT 'check split_cmdline return' "
> > git config alias.split-cmdline-fix 'echo \"' &&
> > test_must_fail git split-cmdline-fix &&
> > echo foo > foo &&
> > @@ -1156,7 +1156,7 @@ test_expect_success 'git -c works with aliases of builtins' '
> > test_cmp expect actual
> > '
>
> Looking at this first test, for example, I see two places where we
> modify the configuration file:
>
> - git config alias.split-cmdline-fix 'echo \"'
> - git config branch.main.mergeoptions 'echo \"'
>
> I think I am missing some detail about why we can't do this when we have
> extensions enabled?
The issue is not directly visible in the tests I'm amending here, but
happens in the setup code. What we do is to overwrite the repository's
config like this:
```
cat > .git/config << EOF
[beta] ; silly comment # another comment
noIndent= sillyValue ; 'nother silly comment
# empty line
; comment
haha ="beta" # last silly comment
haha = hello
haha = bello
[nextSection] noNewline = ouch
EOF
```
The problem here is that we drop any extensions that the repository has
been initialized with originally. This seems to work alright in the
context of SHA256 repositories. But with the reftable backend this
pattern will cause test failures because the discarded "refStorage"
extension will make us assume that the repostiory uses the "files"
backend instead of the "reftable" backend. And that starts to go
downhill quite fast when trying to read or write refs.
A "proper" fix for this issue would be to rewrite tests such that we
know to retain those extensions. But I'm just not sure whether that is
really worth it, mostly because the system under test is at a lower
level and thus shouldn't care about repository extensions. After all,
extensions build on top of our config code.
Patrick
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2024-01-10 7:15 UTC|newest]
Thread overview: 54+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-09 12:17 [PATCH 0/6] t: mark "files"-backend specific tests Patrick Steinhardt
2024-01-09 12:17 ` [PATCH 1/6] t1300: mark tests to require default repo format Patrick Steinhardt
2024-01-09 18:41 ` Taylor Blau
2024-01-10 7:15 ` Patrick Steinhardt [this message]
2024-01-09 19:35 ` Eric Sunshine
2024-01-10 7:17 ` Patrick Steinhardt
2024-01-09 12:17 ` [PATCH 2/6] t1301: mark test for `core.sharedRepository` as reffiles specific Patrick Steinhardt
2024-01-09 12:17 ` [PATCH 3/6] t1302: make tests more robust with new extensions Patrick Steinhardt
2024-01-09 18:43 ` Taylor Blau
2024-01-09 12:17 ` [PATCH 4/6] t1419: mark test suite as files-backend specific Patrick Steinhardt
2024-01-09 19:40 ` Eric Sunshine
2024-01-10 7:30 ` Patrick Steinhardt
2024-01-10 16:27 ` Junio C Hamano
2024-01-11 5:05 ` Patrick Steinhardt
2024-01-09 12:17 ` [PATCH 5/6] t5526: break test submodule differently Patrick Steinhardt
2024-01-09 19:23 ` Eric Sunshine
2024-01-10 7:41 ` Patrick Steinhardt
2024-01-09 12:17 ` [PATCH 6/6] t: mark tests regarding git-pack-refs(1) to be backend specific Patrick Steinhardt
2024-01-10 9:01 ` [PATCH v2 0/6] t: mark "files"-backend specific tests Patrick Steinhardt
2024-01-10 9:01 ` [PATCH v2 1/6] t1300: make tests more robust with non-default ref backends Patrick Steinhardt
2024-01-23 13:41 ` Toon Claes
2024-01-23 15:22 ` Patrick Steinhardt
2024-01-23 16:43 ` Justin Tobler
2024-01-23 16:15 ` Christian Couder
2024-01-24 8:52 ` Patrick Steinhardt
2024-01-29 10:32 ` Christian Couder
2024-01-29 10:49 ` Patrick Steinhardt
2024-01-10 9:01 ` [PATCH v2 2/6] t1301: mark test for `core.sharedRepository` as reffiles specific Patrick Steinhardt
2024-01-10 9:01 ` [PATCH v2 3/6] t1302: make tests more robust with new extensions Patrick Steinhardt
2024-01-23 14:08 ` Toon Claes
2024-01-23 15:18 ` Patrick Steinhardt
2024-01-23 16:15 ` Christian Couder
2024-01-24 8:52 ` Patrick Steinhardt
2024-01-10 9:01 ` [PATCH v2 4/6] t1419: mark test suite as files-backend specific Patrick Steinhardt
2024-01-10 9:01 ` [PATCH v2 5/6] t5526: break test submodule differently Patrick Steinhardt
2024-01-10 9:01 ` [PATCH v2 6/6] t: mark tests regarding git-pack-refs(1) to be backend specific Patrick Steinhardt
2024-01-23 16:20 ` [PATCH v2 0/6] t: mark "files"-backend specific tests Christian Couder
2024-01-24 8:45 ` [PATCH v3 " Patrick Steinhardt
2024-01-24 8:45 ` [PATCH v3 1/6] t1300: make tests more robust with non-default ref backends Patrick Steinhardt
2024-01-24 8:45 ` [PATCH v3 2/6] t1301: mark test for `core.sharedRepository` as reffiles specific Patrick Steinhardt
2024-01-24 8:45 ` [PATCH v3 3/6] t1302: make tests more robust with new extensions Patrick Steinhardt
2024-01-24 8:45 ` [PATCH v3 4/6] t1419: mark test suite as files-backend specific Patrick Steinhardt
2024-01-24 8:45 ` [PATCH v3 5/6] t5526: break test submodule differently Patrick Steinhardt
2024-01-24 8:45 ` [PATCH v3 6/6] t: mark tests regarding git-pack-refs(1) to be backend specific Patrick Steinhardt
2024-01-29 11:07 ` [PATCH v4 0/6] t: mark "files"-backend specific tests Patrick Steinhardt
2024-01-29 11:07 ` [PATCH v4 1/6] t1300: make tests more robust with non-default ref backends Patrick Steinhardt
2024-01-29 12:00 ` Christian Couder
2024-01-29 11:07 ` [PATCH v4 2/6] t1301: mark test for `core.sharedRepository` as reffiles specific Patrick Steinhardt
2024-01-29 11:07 ` [PATCH v4 3/6] t1302: make tests more robust with new extensions Patrick Steinhardt
2024-01-29 11:07 ` [PATCH v4 4/6] t1419: mark test suite as files-backend specific Patrick Steinhardt
2024-01-29 11:07 ` [PATCH v4 5/6] t5526: break test submodule differently Patrick Steinhardt
2024-01-29 11:07 ` [PATCH v4 6/6] t: mark tests regarding git-pack-refs(1) to be backend specific Patrick Steinhardt
2024-01-29 12:03 ` [PATCH v4 0/6] t: mark "files"-backend specific tests Christian Couder
2024-01-29 20:38 ` Junio C Hamano
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZZ5EBojTbQ4pyGx-@tanuki \
--to=ps@pks.im \
--cc=git@vger.kernel.org \
--cc=me@ttaylorr.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.
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 NNTP newsgroup(s).