git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Taylor Blau <me@ttaylorr.com>
Cc: git@vger.kernel.org,  Jeff King <peff@peff.net>
Subject: Re: [PATCH] t/t7700-repack.sh: fix test breakages with `GIT_TEST_MULTI_PACK_INDEX=1`
Date: Tue, 02 Apr 2024 11:37:10 -0700	[thread overview]
Message-ID: <xmqqr0fn4nmx.fsf@gitster.g> (raw)
In-Reply-To: <7e8d435d58eea19d2aae0be366720f5956d29a5d.1712075189.git.me@ttaylorr.com> (Taylor Blau's message of "Tue, 2 Apr 2024 12:26:34 -0400")

Taylor Blau <me@ttaylorr.com> writes:

> There are a handful of related test breakages which are found when
> running t/t7700-repack.sh with GIT_TEST_MULTI_PACK_INDEX set to "1" in
> your environment.
>
> Both test failures are the result of something like:
>
>     git repack --write-midx --write-bitmap-index [...] &&
>
>     test_path_is_file $midx &&
>     test_path_is_file $midx-$(midx_checksum $objdir).bitmap
>
> , where we repack instructing Git to write a new MIDX and corresponding
> MIDX bitamp.
>
> The error occurs when GIT_TEST_MULTI_PACK_INDEX=1 is found in the
> enviornment. This causes Git to write out a second MIDX (after
> processing the builtin's `--write-midx` argument) which is identical to
> the first, but does not request a bitmap (since we did not set the
> GIT_TEST_MULTI_PACK_INDEX_WRITE_BITMAP variable in the environment).

Doesn't it sound more like a bug, though?  If a command line option
requests something, should we still be honoring a contradicting
instruction given by environment variable(s)?

But anyway.

> diff --git a/t/t7700-repack.sh b/t/t7700-repack.sh
> index 94f9f4a1da..127efe99f8 100755
> --- a/t/t7700-repack.sh
> +++ b/t/t7700-repack.sh
> @@ -629,6 +629,7 @@ test_expect_success '--write-midx with preferred bitmap tips' '
>  		git log --format="create refs/tags/%s/%s %H" HEAD >refs &&
>  		git update-ref --stdin <refs &&
>  
> +		GIT_TEST_MULTI_PACK_INDEX=0 \
>  		git repack --write-midx --write-bitmap-index &&
>  		test_path_is_file $midx &&
>  		test_path_is_file $midx-$(midx_checksum $objdir).bitmap &&

Is it a viable alternative approach to skip this check (and the
other one) when GIT_TEST_MULTI_PACK_INDEX is set (i.e., lazy
prereq).  It will give us a better documentation value, e.g.,

	test_lazy_prereq FORCED_MIDX '
                # Features that are broken when GIT_TEST_* forces it
                # to enable are protexted with this prerequisite.
		test "$GIT_TEST_MULTI_PACK_INDEX" = 1;
	'

	test_expect_success !FORCED_MIDX '--write-midx with ...' '
		...
	'

With a single comment, we can annotate any future tests that relies
on features working correctly even with GIT_TEST_MULTI_PACK_INDEX.


  reply	other threads:[~2024-04-02 18:37 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-02 16:26 [PATCH] t/t7700-repack.sh: fix test breakages with `GIT_TEST_MULTI_PACK_INDEX=1` Taylor Blau
2024-04-02 18:37 ` Junio C Hamano [this message]
2024-04-02 18:45   ` Taylor Blau
2024-04-02 19:55     ` Junio C Hamano
2024-04-02 20:04       ` Taylor Blau
2024-04-02 20:24     ` Jeff King
2024-04-02 22:10       ` 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

  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=xmqqr0fn4nmx.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=me@ttaylorr.com \
    --cc=peff@peff.net \
    /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).