Skip to content

Commit 3658170

Browse files
committed
Merge branch 'es/fix-chained-tests'
Fix broken "&&-" chains and failures in early iterations of a loop. * es/fix-chained-tests: t5329: notice a failure within a loop t: detect and signal failure within loop t1092: fix buggy sparse "blame" test t2407: fix broken &&-chains in compound statement
2 parents 0d2cf16 + 9905e80 commit 3658170

5 files changed

+14
-13
lines changed

t/perf/p7527-builtin-fsmonitor.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ test_expect_success "Cleanup temp and matrix branches" "
249249
do
250250
for fsm_val in $fsm_values
251251
do
252-
cleanup $uc_val $fsm_val
252+
cleanup $uc_val $fsm_val || return 1
253253
done
254254
done
255255
"

t/t1092-sparse-checkout-compatibility.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -556,7 +556,7 @@ test_expect_success 'blame with pathspec inside sparse definition' '
556556
deep/deeper1/a \
557557
deep/deeper1/deepest/a
558558
do
559-
test_all_match git blame $file
559+
test_all_match git blame $file || return 1
560560
done
561561
'
562562

@@ -567,7 +567,7 @@ test_expect_success 'blame with pathspec outside sparse definition' '
567567
init_repos &&
568568
test_sparse_match git sparse-checkout set &&
569569
570-
for file in a \
570+
for file in \
571571
deep/a \
572572
deep/deeper1/a \
573573
deep/deeper1/deepest/a
@@ -579,7 +579,7 @@ test_expect_success 'blame with pathspec outside sparse definition' '
579579
# We compare sparse-checkout-err and sparse-index-err in
580580
# `test_sparse_match`. Given we know they are the same, we
581581
# only check the content of sparse-index-err here.
582-
test_cmp expect sparse-index-err
582+
test_cmp expect sparse-index-err || return 1
583583
done
584584
'
585585

@@ -1571,7 +1571,7 @@ test_expect_success 'sparse index is not expanded: blame' '
15711571
deep/deeper1/a \
15721572
deep/deeper1/deepest/a
15731573
do
1574-
ensure_not_expanded blame $file
1574+
ensure_not_expanded blame $file || return 1
15751575
done
15761576
'
15771577

@@ -1907,7 +1907,7 @@ test_expect_success 'rm pathspec outside sparse definition' '
19071907
test_sparse_match test_must_fail git rm $file &&
19081908
test_sparse_match test_must_fail git rm --cached $file &&
19091909
test_sparse_match git rm --sparse $file &&
1910-
test_sparse_match git status --porcelain=v2
1910+
test_sparse_match git status --porcelain=v2 || return 1
19111911
done &&
19121912
19131913
cat >folder1-full <<-EOF &&

t/t2407-worktree-heads.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,10 @@ test_expect_success 'setup' '
4141
test_expect_success 'refuse to overwrite: checked out in worktree' '
4242
for i in 1 2 3 4
4343
do
44-
test_must_fail git branch -f wt-$i HEAD 2>err
44+
test_must_fail git branch -f wt-$i HEAD 2>err &&
4545
grep "cannot force update the branch" err &&
4646
47-
test_must_fail git branch -D wt-$i 2>err
47+
test_must_fail git branch -D wt-$i 2>err &&
4848
grep "Cannot delete branch" err || return 1
4949
done
5050
'

t/t5329-pack-objects-cruft.sh

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ basic_cruft_pack_tests () {
2929
while read oid
3030
do
3131
path="$objdir/$(test_oid_to_path "$oid")" &&
32-
printf "%s %d\n" "$oid" "$(test-tool chmtime --get "$path")"
32+
printf "%s %d\n" "$oid" "$(test-tool chmtime --get "$path")" ||
33+
echo "object list generation failed for $oid"
3334
done |
3435
sort -k1
3536
) >expect &&
@@ -232,7 +233,7 @@ test_expect_success 'cruft tags rescue tagged objects' '
232233
while read oid
233234
do
234235
test-tool chmtime -1000 \
235-
"$objdir/$(test_oid_to_path $oid)"
236+
"$objdir/$(test_oid_to_path $oid)" || exit 1
236237
done <objects &&
237238
238239
test-tool chmtime -500 \
@@ -272,7 +273,7 @@ test_expect_success 'cruft commits rescue parents, trees' '
272273
while read object
273274
do
274275
test-tool chmtime -1000 \
275-
"$objdir/$(test_oid_to_path $object)"
276+
"$objdir/$(test_oid_to_path $object)" || exit 1
276277
done <objects &&
277278
test-tool chmtime +500 "$objdir/$(test_oid_to_path \
278279
$(git rev-parse HEAD))" &&
@@ -345,7 +346,7 @@ test_expect_success 'expired objects are pruned' '
345346
while read object
346347
do
347348
test-tool chmtime -1000 \
348-
"$objdir/$(test_oid_to_path $object)"
349+
"$objdir/$(test_oid_to_path $object)" || exit 1
349350
done <objects &&
350351
351352
keep="$(basename "$(ls $packdir/pack-*.pack)")" &&

t/t6429-merge-sequence-rename-caching.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -725,7 +725,7 @@ test_expect_success 'avoid assuming we detected renames' '
725725
mkdir unrelated &&
726726
for i in $(test_seq 1 10)
727727
do
728-
>unrelated/$i
728+
>unrelated/$i || exit 1
729729
done &&
730730
test_seq 2 10 >numbers &&
731731
test_seq 12 20 >values &&

0 commit comments

Comments
 (0)