Skip to content

Commit bbc393a

Browse files
ttaylorrgitster
authored andcommitted
t/t5332-multi-pack-reuse.sh: verify pack generation with --strict
In our tests for multi-pack reuse, we have two helper functions: - test_pack_objects_reused_all(), and - test_pack_objects_reused() which invoke pack-objects (either with `--all`, or the supplied tips via stdin, respectively) and ensure that (a) the number of reused objects, and (b) the number of packs which those objects were reused from both match the expected values. Both functions discard the output of pack-objects and assert only on the contents of the trace2 stream. However, if we store the pack and attempt to index it with `--strict`, we find that a number of our tests are broken, indicating a bug within multi-pack reuse. That bug will be addressed in a subsequent commit. But let's first harden these tests by trying to index the resulting pack, marking the tests which fail appropriately. Signed-off-by: Taylor Blau <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 159f2d5 commit bbc393a

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

t/t5332-multi-pack-reuse.sh

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,20 +31,24 @@ test_pack_objects_reused_all () {
3131
: >trace2.txt &&
3232
GIT_TRACE2_EVENT="$PWD/trace2.txt" \
3333
git pack-objects --stdout --revs --all --delta-base-offset \
34-
>/dev/null &&
34+
>got.pack &&
3535

3636
test_pack_reused "$1" <trace2.txt &&
37-
test_packs_reused "$2" <trace2.txt
37+
test_packs_reused "$2" <trace2.txt &&
38+
39+
git index-pack --strict -o got.idx got.pack
3840
}
3941

4042
# test_pack_objects_reused <pack-reused> <packs-reused>
4143
test_pack_objects_reused () {
4244
: >trace2.txt &&
4345
GIT_TRACE2_EVENT="$PWD/trace2.txt" \
44-
git pack-objects --stdout --revs >/dev/null &&
46+
git pack-objects --stdout --revs >got.pack &&
4547

4648
test_pack_reused "$1" <trace2.txt &&
47-
test_packs_reused "$2" <trace2.txt
49+
test_packs_reused "$2" <trace2.txt &&
50+
51+
git index-pack --strict -o got.idx got.pack
4852
}
4953

5054
test_expect_success 'preferred pack is reused for single-pack reuse' '
@@ -65,7 +69,7 @@ test_expect_success 'multi-pack reuse is disabled by default' '
6569
test_pack_objects_reused_all 3 1
6670
'
6771

68-
test_expect_success 'feature.experimental implies multi-pack reuse' '
72+
test_expect_failure 'feature.experimental implies multi-pack reuse' '
6973
test_config feature.experimental true &&
7074
7175
test_pack_objects_reused_all 6 2
@@ -82,7 +86,7 @@ test_expect_success 'enable multi-pack reuse' '
8286
git config pack.allowPackReuse multi
8387
'
8488

85-
test_expect_success 'reuse all objects from subset of bitmapped packs' '
89+
test_expect_failure 'reuse all objects from subset of bitmapped packs' '
8690
test_commit C &&
8791
git repack -d &&
8892
@@ -96,7 +100,7 @@ test_expect_success 'reuse all objects from subset of bitmapped packs' '
96100
test_pack_objects_reused 6 2 <in
97101
'
98102

99-
test_expect_success 'reuse all objects from all packs' '
103+
test_expect_failure 'reuse all objects from all packs' '
100104
test_pack_objects_reused_all 9 3
101105
'
102106

@@ -190,7 +194,7 @@ test_expect_success 'omit delta with uninteresting base (same pack)' '
190194
test_pack_objects_reused 3 1 <in
191195
'
192196

193-
test_expect_success 'omit delta from uninteresting base (cross pack)' '
197+
test_expect_failure 'omit delta from uninteresting base (cross pack)' '
194198
cat >in <<-EOF &&
195199
$(git rev-parse $base)
196200
^$(git rev-parse $delta)

0 commit comments

Comments
 (0)