git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
To: Taylor Blau <me@ttaylorr.com>
Cc: git@vger.kernel.org, peff@peff.net
Subject: Re: [PATCH 4/4] t5326: test propagating hashcache values
Date: Fri, 17 Sep 2021 21:22:51 +0200	[thread overview]
Message-ID: <878rzvdmwq.fsf@evledraar.gmail.com> (raw)
In-Reply-To: <YUTRHaHDjCaxmQyY@nand.local>


On Fri, Sep 17 2021, Taylor Blau wrote:

> On Fri, Sep 17, 2021 at 10:56:09AM +0200, Ævar Arnfjörð Bjarmason wrote:
>> >> It seems the need for this "rm -fr repo" dance instead of just relying
>> >> on test_when_finished "rm -rf repo" is because of a 3x tests in a
>> >> function in tb/multi-pack-bitmaps that should probably be combined into
>> >> one, i.e. they share the same logical "repo" setup.
>> >
>> > Yeah. There's definitely room for clean-up there if we want to have each
>> > of the tests operate on the same repo. I have always found sharing a
>> > repo between tests difficult to reason about, since we have to assume
>> > that any --run parameters could be passed in.
>> >
>> > So I have tended to err on the side of creating and throwing away a new
>> > repo per test, but I understand that's somewhat atypical for Git's
>> > tests.
>>
>> Just in an effort to make myself clear here, because between your note
>> in https://lore.kernel.org/git/YUOds4kcHRgMk5nC@nand.local/ and
>> re-reading my mail here I can barely understand what I meant here :)
>
> Thanks for clarifying; if I could summarize I would say that this
> discussion got started since a new test I added starts with:
>
>     rm -fr repo &&
>     git init repo &&
>     test_when_finished "rm -fr repo"
>
> where the first rm is designed to clean any state left behind from the
> split-up tests added in c51f5a6437c.
>
> I understand your suggestion, and I even think that it may be worth
> doing, but I'm not sure that I buy that any such cleanup is related to
> this series for any reason other than "you happened to add a new test in
> this file which extended the pattern".
>
> So let's pursue the cleanup, but outside of this series (and maybe once
> the dust has settled more generally on the MIDX bitmaps topics to avoid
> having the maintainer deal with any conflicts).

Yes I agree, FWIW I didn't look carefully at what was in-flight where at
the time, or the series this depends on was itself in "seen", I can't
remember which..

>> Or, you can also just not re-use the "repo" name, which is what I did in
>> the fsck tests at
>> https://lore.kernel.org/git/patch-v6-01.22-ebe89f65354-20210907T104559Z-avarab@gmail.com/;
>> then you don't even need test_when_finished "rm -rf[ ...]".
>
> TBH, I think that this is the most appealing thing to do. It's easy and
> doesn't require us to think too hard about test_expect_setup or
> sub-tests or anything like that where I'm not sure the complexity is
> warranted.
>
> I would probably do something like this:

Yeah, that bypasses the cleanup bit, but leaves --run broken as I
described. For new code I think it's good practice to have --run work
too.

Again, I think that's a non-issue here considering the rest of the
dumpster fire in the test suite when it comes to that, so I'm not
suggesting a re-roll or whatever.

I just used the upthread as a jumping off point since you had a question
about these patterns in the other topic, and perhaps you/some bystander
would be convinced and follow that pattern in the future.

> --- >8 ---
>
> diff --git a/t/t5326-multi-pack-bitmaps.sh b/t/t5326-multi-pack-bitmaps.sh
> index ec4aa89f63..11845f67ae 100755
> --- a/t/t5326-multi-pack-bitmaps.sh
> +++ b/t/t5326-multi-pack-bitmaps.sh
> @@ -132,12 +132,12 @@ test_expect_success 'clone with bitmaps enabled' '
>  bitmap_reuse_tests() {
>  	from=$1
>  	to=$2
> +	repo="bitmap-reuse-$from-$to"
>
>  	test_expect_success "setup pack reuse tests ($from -> $to)" '
> -		rm -fr repo &&
> -		git init repo &&
> +		git init $repo &&
>  		(
> -			cd repo &&
> +			cd $repo &&
>  			test_commit_bulk 16 &&
>  			git tag old-tip &&
>
> @@ -154,7 +154,7 @@ bitmap_reuse_tests() {
>
>  	test_expect_success "build bitmap from existing ($from -> $to)" '
>  		(
> -			cd repo &&
> +			cd $repo &&
>  			test_commit_bulk --id=further 16 &&
>  			git tag new-tip &&
>
> @@ -170,7 +170,7 @@ bitmap_reuse_tests() {
>
>  	test_expect_success "verify resulting bitmaps ($from -> $to)" '
>  		(
> -			cd repo &&
> +			cd $repo &&
>  			git for-each-ref &&
>  			git rev-list --test-bitmap refs/tags/old-tip &&
>  			git rev-list --test-bitmap refs/tags/new-tip
> @@ -183,7 +183,6 @@ bitmap_reuse_tests 'MIDX' 'pack'
>  bitmap_reuse_tests 'MIDX' 'MIDX'
>
>  test_expect_success 'missing object closure fails gracefully' '
> -	rm -fr repo &&
>  	git init repo &&
>  	test_when_finished "rm -fr repo" &&
>  	(
> @@ -217,7 +216,6 @@ test_expect_success 'setup partial bitmaps' '
>  basic_bitmap_tests HEAD~
>
>  test_expect_success 'removing a MIDX clears stale bitmaps' '
> -	rm -fr repo &&
>  	git init repo &&
>  	test_when_finished "rm -fr repo" &&
>  	(
> @@ -284,7 +282,6 @@ test_expect_success 'pack.preferBitmapTips' '
>  '
>
>  test_expect_success 'hash-cache values are propagated from pack bitmaps' '
> -	rm -fr repo &&
>  	git init repo &&
>  	test_when_finished "rm -fr repo" &&
>  	(


  reply	other threads:[~2021-09-17 19:26 UTC|newest]

Thread overview: 55+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-07 21:17 [PATCH 0/4] pack-bitmap: permute existing namehash values Taylor Blau
2021-09-07 21:17 ` [PATCH 1/4] t/helper/test-bitmap.c: add 'dump-hashes' mode Taylor Blau
2021-09-08  1:37   ` Ævar Arnfjörð Bjarmason
2021-09-08  2:24     ` Taylor Blau
2021-09-07 21:17 ` [PATCH 2/4] pack-bitmap.c: propagate namehash values from existing bitmaps Taylor Blau
2021-09-07 21:18 ` [PATCH 3/4] midx.c: respect 'pack.writeBitmapHashcache' when writing bitmaps Taylor Blau
2021-09-08  1:40   ` Ævar Arnfjörð Bjarmason
2021-09-08  2:28     ` Taylor Blau
2021-09-09  8:18       ` Ævar Arnfjörð Bjarmason
2021-09-09  9:34         ` Ævar Arnfjörð Bjarmason
2021-09-09 14:55           ` Taylor Blau
2021-09-09 15:50             ` Ævar Arnfjörð Bjarmason
2021-09-09 16:23               ` Taylor Blau
2021-09-09 14:47         ` Taylor Blau
2021-09-13  0:38   ` Junio C Hamano
2021-09-14  1:15     ` Taylor Blau
2021-09-07 21:18 ` [PATCH 4/4] t5326: test propagating hashcache values Taylor Blau
2021-09-08  1:46   ` Ævar Arnfjörð Bjarmason
2021-09-08  2:30     ` Taylor Blau
2021-09-17  8:56       ` Ævar Arnfjörð Bjarmason
2021-09-17 17:32         ` Taylor Blau
2021-09-17 19:22           ` Ævar Arnfjörð Bjarmason [this message]
2021-09-13  0:46   ` Junio C Hamano
2021-09-14  1:12     ` Taylor Blau
2021-09-14  2:05       ` Junio C Hamano
2021-09-14  5:11         ` Taylor Blau
2021-09-14  5:17           ` Taylor Blau
2021-09-14  5:27           ` Jeff King
2021-09-14  5:31             ` Taylor Blau
2021-09-14  5:23         ` Jeff King
2021-09-14  5:49           ` Junio C Hamano
2021-09-14 22:05 ` [PATCH v2 0/7] pack-bitmap: permute existing namehash values Taylor Blau
2021-09-14 22:06   ` [PATCH v2 1/7] t/helper/test-bitmap.c: add 'dump-hashes' mode Taylor Blau
2021-09-14 22:06   ` [PATCH v2 2/7] pack-bitmap.c: propagate namehash values from existing bitmaps Taylor Blau
2021-09-14 22:06   ` [PATCH v2 3/7] midx.c: respect 'pack.writeBitmapHashcache' when writing bitmaps Taylor Blau
2021-09-14 22:06   ` [PATCH v2 4/7] p5326: create missing 'perf-tag' tag Taylor Blau
2021-09-16 22:36     ` Jeff King
2021-09-17  4:14       ` Taylor Blau
2021-09-14 22:06   ` [PATCH v2 5/7] p5326: don't set core.multiPackIndex unnecessarily Taylor Blau
2021-09-16 22:38     ` Jeff King
2021-09-14 22:06   ` [PATCH v2 6/7] p5326: generate pack bitmaps before writing the MIDX bitmap Taylor Blau
2021-09-16 22:45     ` Jeff King
2021-09-17  4:20       ` Taylor Blau
2021-09-14 22:06   ` [PATCH v2 7/7] t5326: test propagating hashcache values Taylor Blau
2021-09-16 22:49     ` Jeff King
2021-09-16 22:52   ` [PATCH v2 0/7] pack-bitmap: permute existing namehash values Jeff King
2021-09-17 21:21 ` [PATCH v3 " Taylor Blau
2021-09-17 21:21   ` [PATCH v3 1/7] t/helper/test-bitmap.c: add 'dump-hashes' mode Taylor Blau
2021-09-17 21:21   ` [PATCH v3 2/7] pack-bitmap.c: propagate namehash values from existing bitmaps Taylor Blau
2021-09-17 21:21   ` [PATCH v3 3/7] midx.c: respect 'pack.writeBitmapHashcache' when writing bitmaps Taylor Blau
2021-09-17 21:21   ` [PATCH v3 4/7] p5326: create missing 'perf-tag' tag Taylor Blau
2021-09-17 21:21   ` [PATCH v3 5/7] p5326: don't set core.multiPackIndex unnecessarily Taylor Blau
2021-09-17 21:21   ` [PATCH v3 6/7] p5326: generate pack bitmaps before writing the MIDX bitmap Taylor Blau
2021-09-17 21:21   ` [PATCH v3 7/7] t5326: test propagating hashcache values Taylor Blau
2021-09-17 22:12   ` [PATCH v3 0/7] pack-bitmap: permute existing namehash values Jeff King

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=878rzvdmwq.fsf@evledraar.gmail.com \
    --to=avarab@gmail.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.
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).