Skip to content

Commit f06481f

Browse files
newrengitster
authored andcommitted
t/: new helper for tests that pass with ort but fail with recursive
There are a number of tests that the "recursive" backend does not handle correctly but which the redesign in "ort" will. Add a new helper in lib-merge.sh for selecting a different test expectation based on the setting of GIT_TEST_MERGE_ALGORITHM, and use it in various testcases to document which ones we expect to fail under recursive but pass under ort. Signed-off-by: Elijah Newren <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent c64432a commit f06481f

6 files changed

+34
-16
lines changed

t/lib-merge.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Helper functions used by merge tests.
2+
3+
test_expect_merge_algorithm () {
4+
status_for_recursive=$1 status_for_ort=$2
5+
shift 2
6+
7+
if test "$GIT_TEST_MERGE_ALGORITHM" = ort
8+
then
9+
test_expect_${status_for_ort} "$@"
10+
else
11+
test_expect_${status_for_recursive} "$@"
12+
fi
13+
}

t/t6416-recursive-corner-cases.sh

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
test_description='recursive merge corner cases involving criss-cross merges'
44

55
. ./test-lib.sh
6+
. "$TEST_DIRECTORY"/lib-merge.sh
67

78
#
89
# L1 L2
@@ -1069,7 +1070,7 @@ test_expect_success 'setup symlink modify/modify' '
10691070
)
10701071
'
10711072

1072-
test_expect_failure 'check symlink modify/modify' '
1073+
test_expect_merge_algorithm failure success 'check symlink modify/modify' '
10731074
(
10741075
cd symlink-modify-modify &&
10751076
@@ -1135,7 +1136,7 @@ test_expect_success 'setup symlink add/add' '
11351136
)
11361137
'
11371138

1138-
test_expect_failure 'check symlink add/add' '
1139+
test_expect_merge_algorithm failure success 'check symlink add/add' '
11391140
(
11401141
cd symlink-add-add &&
11411142
@@ -1223,7 +1224,7 @@ test_expect_success 'setup submodule modify/modify' '
12231224
)
12241225
'
12251226

1226-
test_expect_failure 'check submodule modify/modify' '
1227+
test_expect_merge_algorithm failure success 'check submodule modify/modify' '
12271228
(
12281229
cd submodule-modify-modify &&
12291230
@@ -1311,7 +1312,7 @@ test_expect_success 'setup submodule add/add' '
13111312
)
13121313
'
13131314

1314-
test_expect_failure 'check submodule add/add' '
1315+
test_expect_merge_algorithm failure success 'check submodule add/add' '
13151316
(
13161317
cd submodule-add-add &&
13171318
@@ -1386,7 +1387,7 @@ test_expect_success 'setup conflicting entry types (submodule vs symlink)' '
13861387
)
13871388
'
13881389

1389-
test_expect_failure 'check conflicting entry types (submodule vs symlink)' '
1390+
test_expect_merge_algorithm failure success 'check conflicting entry types (submodule vs symlink)' '
13901391
(
13911392
cd submodule-symlink-add-add &&
13921393

t/t6422-merge-rename-corner-cases.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ test_description="recursive merge corner cases w/ renames but not criss-crosses"
44
# t6036 has corner cases that involve both criss-cross merges and renames
55

66
. ./test-lib.sh
7+
. "$TEST_DIRECTORY"/lib-merge.sh
78

89
test_setup_rename_delete_untracked () {
910
test_create_repo rename-delete-untracked &&
@@ -878,7 +879,7 @@ test_setup_rad () {
878879
)
879880
}
880881

881-
test_expect_failure 'rad-check: rename/add/delete conflict' '
882+
test_expect_merge_algorithm failure success 'rad-check: rename/add/delete conflict' '
882883
test_setup_rad &&
883884
(
884885
cd rad &&
@@ -951,7 +952,7 @@ test_setup_rrdd () {
951952
)
952953
}
953954

954-
test_expect_failure 'rrdd-check: rename/rename(2to1)/delete/delete conflict' '
955+
test_expect_merge_algorithm failure success 'rrdd-check: rename/rename(2to1)/delete/delete conflict' '
955956
test_setup_rrdd &&
956957
(
957958
cd rrdd &&
@@ -1040,7 +1041,7 @@ test_setup_mod6 () {
10401041
)
10411042
}
10421043

1043-
test_expect_failure 'mod6-check: chains of rename/rename(1to2) and rename/rename(2to1)' '
1044+
test_expect_merge_algorithm failure success 'mod6-check: chains of rename/rename(1to2) and rename/rename(2to1)' '
10441045
test_setup_mod6 &&
10451046
(
10461047
cd mod6 &&

t/t6423-merge-rename-directories.sh

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ test_description="recursive merge with directory renames"
2626
# files that might be renamed into each other's paths.)
2727

2828
. ./test-lib.sh
29+
. "$TEST_DIRECTORY"/lib-merge.sh
2930

3031

3132
###########################################################################
@@ -1339,7 +1340,7 @@ test_setup_6b1 () {
13391340
)
13401341
}
13411342

1342-
test_expect_failure '6b1: Same renames done on both sides, plus another rename' '
1343+
test_expect_merge_algorithm failure success '6b1: Same renames done on both sides, plus another rename' '
13431344
test_setup_6b1 &&
13441345
(
13451346
cd 6b1 &&
@@ -1412,7 +1413,7 @@ test_setup_6b2 () {
14121413
)
14131414
}
14141415

1415-
test_expect_failure '6b2: Same rename done on both sides' '
1416+
test_expect_merge_algorithm failure success '6b2: Same rename done on both sides' '
14161417
test_setup_6b2 &&
14171418
(
14181419
cd 6b2 &&
@@ -3471,7 +3472,7 @@ test_setup_10e () {
34713472
)
34723473
}
34733474

3474-
test_expect_failure '10e: Does git complain about untracked file that is not really in the way?' '
3475+
test_expect_merge_algorithm failure success '10e: Does git complain about untracked file that is not really in the way?' '
34753476
test_setup_10e &&
34763477
(
34773478
cd 10e &&
@@ -4104,7 +4105,7 @@ test_setup_12b1 () {
41044105
)
41054106
}
41064107

4107-
test_expect_failure '12b1: Moving two directory hierarchies into each other' '
4108+
test_expect_merge_algorithm failure success '12b1: Moving two directory hierarchies into each other' '
41084109
test_setup_12b1 &&
41094110
(
41104111
cd 12b1 &&
@@ -4272,7 +4273,7 @@ test_setup_12c1 () {
42724273
)
42734274
}
42744275

4275-
test_expect_failure '12c1: Moving one directory hierarchy into another w/ content merge' '
4276+
test_expect_merge_algorithm failure success '12c1: Moving one directory hierarchy into another w/ content merge' '
42764277
test_setup_12c1 &&
42774278
(
42784279
cd 12c1 &&
@@ -4632,7 +4633,7 @@ test_setup_12f () {
46324633
)
46334634
}
46344635

4635-
test_expect_failure '12f: Trivial directory resolve, caching, all kinds of fun' '
4636+
test_expect_merge_algorithm failure success '12f: Trivial directory resolve, caching, all kinds of fun' '
46364637
test_setup_12f &&
46374638
(
46384639
cd 12f &&

t/t6426-merge-skip-unneeded-updates.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ test_description="merge cases"
2323
# files that might be renamed into each other's paths.)
2424

2525
. ./test-lib.sh
26+
. "$TEST_DIRECTORY"/lib-merge.sh
2627

2728

2829
###########################################################################
@@ -666,7 +667,7 @@ test_setup_4a () {
666667
# correct requires doing the merge in-memory first, then realizing that no
667668
# updates to the file are necessary, and thus that we can just leave the path
668669
# alone.
669-
test_expect_failure '4a: Change on A, change on B subset of A, dirty mods present' '
670+
test_expect_merge_algorithm failure success '4a: Change on A, change on B subset of A, dirty mods present' '
670671
test_setup_4a &&
671672
(
672673
cd 4a &&

t/t6430-merge-recursive.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
test_description='merge-recursive backend test'
44

55
. ./test-lib.sh
6+
. "$TEST_DIRECTORY"/lib-merge.sh
67

78
test_expect_success 'setup 1' '
89
@@ -641,7 +642,7 @@ test_expect_success 'merge-recursive copy vs. rename' '
641642
test_cmp expected actual
642643
'
643644

644-
test_expect_failure 'merge-recursive rename vs. rename/symlink' '
645+
test_expect_merge_algorithm failure success 'merge-recursive rename vs. rename/symlink' '
645646
646647
git checkout -f rename &&
647648
git merge rename-ln &&

0 commit comments

Comments
 (0)