Skip to content

Commit e5e0691

Browse files
committed
t: migrate callers to test_trace2_data_singular
Switch all call sites that expect a single occurrence to use the new function. The two calls in t5620 test 7 ("backfill min batch size") stay on the old function since they expect multiple entries. Rename the trace file in t5620 test 14 to avoid a collision with test 13 that the stricter check exposed. Signed-off-by: Kristofer Karlsson <krka@spotify.com>
1 parent dd7d3a0 commit e5e0691

5 files changed

Lines changed: 25 additions & 25 deletions

File tree

t/t3500-cherry.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ test_expect_success 'cherry in partial clone does bulk prefetch' '
9292
9393
grep "child_start.*fetch.negotiationAlgorithm" trace.output >fetches &&
9494
test_line_count = 1 fetches &&
95-
test_trace2_data promisor fetch_count 4 <trace.output &&
95+
test_trace2_data_singular promisor fetch_count 4 <trace.output &&
9696
9797
# A second invocation should not refetch any blobs, since
9898
# the prefetch is expected to filter out OIDs that are

t/t5332-multi-pack-reuse.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ objdir=.git/objects
1818
packdir=$objdir/pack
1919

2020
test_pack_reused () {
21-
test_trace2_data pack-objects pack-reused "$1"
21+
test_trace2_data_singular pack-objects pack-reused "$1"
2222
}
2323

2424
test_packs_reused () {
25-
test_trace2_data pack-objects packs-reused "$1"
25+
test_trace2_data_singular pack-objects packs-reused "$1"
2626
}
2727

2828

t/t5333-pseudo-merge-bitmaps.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,15 @@ test_pseudo_merge_commits () {
1515
}
1616

1717
test_pseudo_merges_satisfied () {
18-
test_trace2_data bitmap pseudo_merges_satisfied "$1"
18+
test_trace2_data_singular bitmap pseudo_merges_satisfied "$1"
1919
}
2020

2121
test_pseudo_merges_cascades () {
22-
test_trace2_data bitmap pseudo_merges_cascades "$1"
22+
test_trace2_data_singular bitmap pseudo_merges_cascades "$1"
2323
}
2424

2525
test_pseudo_merges_reused () {
26-
test_trace2_data pack-bitmap-write building_bitmaps_pseudo_merge_reused "$1"
26+
test_trace2_data_singular pack-bitmap-write building_bitmaps_pseudo_merge_reused "$1"
2727
}
2828

2929
tag_everything () {

t/t5620-backfill.sh

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ test_expect_success 'do partial clone 1, backfill gets all objects' '
116116
-C backfill1 backfill &&
117117
118118
# We should have engaged the partial clone machinery
119-
test_trace2_data promisor fetch_count 48 <backfill-file-trace &&
119+
test_trace2_data_singular promisor fetch_count 48 <backfill-file-trace &&
120120
121121
# No more missing objects!
122122
git -C backfill1 rev-list --quiet --objects --missing=print HEAD >revs2 &&
@@ -160,8 +160,8 @@ test_expect_success 'backfill --sparse' '
160160
# older versions of the four files at tip.
161161
GIT_TRACE2_EVENT="$(pwd)/sparse-trace1" git \
162162
-C backfill3 backfill --sparse &&
163-
test_trace2_data promisor fetch_count 4 <sparse-trace1 &&
164-
test_trace2_data path-walk paths 5 <sparse-trace1 &&
163+
test_trace2_data_singular promisor fetch_count 4 <sparse-trace1 &&
164+
test_trace2_data_singular path-walk paths 5 <sparse-trace1 &&
165165
git -C backfill3 rev-list --quiet --objects --missing=print HEAD >missing &&
166166
test_line_count = 40 missing &&
167167
@@ -172,8 +172,8 @@ test_expect_success 'backfill --sparse' '
172172
git -C backfill3 sparse-checkout set d &&
173173
GIT_TRACE2_EVENT="$(pwd)/sparse-trace2" git \
174174
-C backfill3 backfill --sparse &&
175-
test_trace2_data promisor fetch_count 8 <sparse-trace2 &&
176-
test_trace2_data path-walk paths 15 <sparse-trace2 &&
175+
test_trace2_data_singular promisor fetch_count 8 <sparse-trace2 &&
176+
test_trace2_data_singular path-walk paths 15 <sparse-trace2 &&
177177
git -C backfill3 rev-list --quiet --objects --missing=print HEAD >missing &&
178178
test_line_count = 24 missing &&
179179
@@ -194,8 +194,8 @@ test_expect_success 'backfill auto-detects sparse-checkout from config' '
194194
GIT_TRACE2_EVENT="$(pwd)/auto-sparse-trace" git \
195195
-C backfill-auto-sparse backfill &&
196196
197-
test_trace2_data promisor fetch_count 4 <auto-sparse-trace &&
198-
test_trace2_data path-walk paths 5 <auto-sparse-trace
197+
test_trace2_data_singular promisor fetch_count 4 <auto-sparse-trace &&
198+
test_trace2_data_singular path-walk paths 5 <auto-sparse-trace
199199
'
200200

201201
test_expect_success 'backfill --sparse without cone mode (positive)' '
@@ -218,10 +218,10 @@ test_expect_success 'backfill --sparse without cone mode (positive)' '
218218
219219
GIT_TRACE2_EVENT="$(pwd)/no-cone-trace1" git \
220220
-C backfill4 backfill --sparse &&
221-
test_trace2_data promisor fetch_count 6 <no-cone-trace1 &&
221+
test_trace2_data_singular promisor fetch_count 6 <no-cone-trace1 &&
222222
223223
# This walk needed to visit all directories to search for these paths.
224-
test_trace2_data path-walk paths 12 <no-cone-trace1 &&
224+
test_trace2_data_singular path-walk paths 12 <no-cone-trace1 &&
225225
git -C backfill4 rev-list --quiet --objects --missing=print HEAD >missing &&
226226
test_line_count = 36 missing
227227
'
@@ -246,11 +246,11 @@ test_expect_success 'backfill --sparse without cone mode (negative)' '
246246
247247
GIT_TRACE2_EVENT="$(pwd)/no-cone-trace2" git \
248248
-C backfill5 backfill --sparse &&
249-
test_trace2_data promisor fetch_count 18 <no-cone-trace2 &&
249+
test_trace2_data_singular promisor fetch_count 18 <no-cone-trace2 &&
250250
251251
# This walk needed to visit all directories to search for these paths, plus
252252
# 12 extra "file.?.txt" paths than the previous test.
253-
test_trace2_data path-walk paths 24 <no-cone-trace2 &&
253+
test_trace2_data_singular path-walk paths 24 <no-cone-trace2 &&
254254
git -C backfill5 rev-list --quiet --objects --missing=print HEAD >missing &&
255255
test_line_count = 12 missing
256256
'
@@ -268,7 +268,7 @@ test_expect_success 'backfill with revision range' '
268268
GIT_TRACE2_EVENT="$(pwd)/backfill-trace" git -C backfill-revs backfill HEAD~2..HEAD &&
269269
270270
# 36 objects downloaded, 12 still missing
271-
test_trace2_data promisor fetch_count 36 <backfill-trace &&
271+
test_trace2_data_singular promisor fetch_count 36 <backfill-trace &&
272272
git -C backfill-revs rev-list --quiet --objects --missing=print HEAD >missing &&
273273
test_line_count = 12 missing
274274
'
@@ -288,10 +288,10 @@ test_expect_success 'backfill with revisions over stdin' '
288288
^HEAD~2
289289
EOF
290290
291-
GIT_TRACE2_EVENT="$(pwd)/backfill-trace" git -C backfill-revs backfill --stdin <in &&
291+
GIT_TRACE2_EVENT="$(pwd)/backfill-stdin-trace" git -C backfill-revs backfill --stdin <in &&
292292
293293
# 36 objects downloaded, 12 still missing
294-
test_trace2_data promisor fetch_count 36 <backfill-trace &&
294+
test_trace2_data_singular promisor fetch_count 36 <backfill-stdin-trace &&
295295
git -C backfill-revs rev-list --quiet --objects --missing=print HEAD >missing &&
296296
test_line_count = 12 missing
297297
'
@@ -523,7 +523,7 @@ test_expect_success 'backfilling over HTTP succeeds' '
523523
-C backfill-http backfill &&
524524
525525
# We should have engaged the partial clone machinery
526-
test_trace2_data promisor fetch_count 48 <backfill-http-trace &&
526+
test_trace2_data_singular promisor fetch_count 48 <backfill-http-trace &&
527527
528528
# Confirm all objects are present, none missing.
529529
git -C backfill-http rev-list --objects --all >rev-list-out &&

t/t7810-grep.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1964,8 +1964,8 @@ test_expect_success 'grep of revision in partial clone batches prefetch and hono
19641964
19651965
# Exactly the two a/*.txt blobs should have been requested, and
19661966
# the server packed those two objects in the response.
1967-
test_trace2_data promisor fetch_count 2 <grep-trace-pathspec &&
1968-
test_trace2_data pack-objects written 2 <grep-trace-pathspec &&
1967+
test_trace2_data_singular promisor fetch_count 2 <grep-trace-pathspec &&
1968+
test_trace2_data_singular pack-objects written 2 <grep-trace-pathspec &&
19691969
19701970
# b/matches.md should still be missing locally.
19711971
git -C grep-partial rev-list --quiet --objects \
@@ -1979,8 +1979,8 @@ test_expect_success 'grep of revision in partial clone batches prefetch and hono
19791979
git -C grep-partial grep -c "needle" HEAD >result &&
19801980
19811981
test_line_count = 2 result &&
1982-
test_trace2_data promisor fetch_count 1 <grep-trace-all &&
1983-
test_trace2_data pack-objects written 1 <grep-trace-all &&
1982+
test_trace2_data_singular promisor fetch_count 1 <grep-trace-all &&
1983+
test_trace2_data_singular pack-objects written 1 <grep-trace-all &&
19841984
19851985
# Everything is local now.
19861986
git -C grep-partial rev-list --quiet --objects \

0 commit comments

Comments
 (0)