git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 1/9] t/: new helper for tests that pass with ort but fail with recursive

From
Elijah Newren <newren@gmail.com>
Date
Oct 23, 2020, 17:25 UTC
Message-ID
<CABPp-BEtBWktGB0ksfk5YLhVDfmUJ-QxUMiYtMANL1KhXd8qTA@mail.gmail.com>
In-Reply-To
<xmqqr1pohos4.fsf@gitster.c.googlers.com>
On Fri, Oct 23, 2020 at 9:48 AM Junio C Hamano <gitster@pobox.com> wrote:
Show 49 quoted lines
>
> "Elijah Newren via GitGitGadget" <gitgitgadget@gmail.com> writes:
>
> > From: Elijah Newren <newren@gmail.com>
> >
> > 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 <newren@gmail.com>
> > ---
> >  t/lib-merge.sh                         | 15 +++++++++++++++
> >  t/t6416-recursive-corner-cases.sh      | 11 ++++++-----
> >  t/t6422-merge-rename-corner-cases.sh   |  7 ++++---
> >  t/t6423-merge-rename-directories.sh    | 13 +++++++------
> >  t/t6426-merge-skip-unneeded-updates.sh |  3 ++-
> >  t/t6430-merge-recursive.sh             |  3 ++-
> >  6 files changed, 36 insertions(+), 16 deletions(-)
> >  create mode 100644 t/lib-merge.sh
> >
> > diff --git a/t/lib-merge.sh b/t/lib-merge.sh
> > new file mode 100644
> > index 0000000000..fac2bc5919
> > --- /dev/null
> > +++ b/t/lib-merge.sh
> > @@ -0,0 +1,15 @@
> > +# Helper functions used by merge tests.
> > +
> > +test_expect_merge_algorithm () {
> > +     status_for_recursive=$1
> > +     shift
> > +     status_for_ort=$1
> > +     shift
>
> Smaller than minor, but I'd find
>
>         status_for_recursive=$1 status_for_ort=$2
>         shift 2
>
> easier to see that which one is for which by matching the order in
> which the calling sites, e.g.
>
>         test_expect_merge_algorithm success failure \
>                 here comes the commands being tested
>
> lists them.
I can fix that up.
Show 15 quoted lines
>
> > +     if test "$GIT_TEST_MERGE_ALGORITHM" = ort
> > +     then
> > +             test_expect_${status_for_ort} "$@"
> > +     else
> > +             test_expect_${status_for_recursive} "$@"
> > +     fi
>
> I expect this to be purely transitory, so it is fine.  If not,
> something along the lines of ...
>
>         eval test_expect='$'status_for_"$GIT_TEST_MERGE_ALGORITHM"
>         $test_expect "$@"
>
> ... might be what I would suggest, though ;-).

I also expect it to be transitory, but how long that transition is depends more on how long it takes for others to become comfortable with removing merge-recursive.c once merge-ort.c is in place. I suspect at a minimum it's a cycle or two after ort becomes the default (which at a minimum would come a cycle or two after ort is finished and available). If for some reason folks don't eventually become comfortable with removing merge-recursive, then we might need to revisit.

Show 19 quoted lines
> And the users are just too pleasant to see, with full of "failure
> sucess", which is the second best outcome we want to see ;-)
>
> > +test_expect_merge_algorithm failure success 'check symlink mo...
> > +test_expect_merge_algorithm failure success 'check symlink ad...
> > +test_expect_merge_algorithm failure success 'check submodule ...
> > +test_expect_merge_algorithm failure success 'check submodule ...
> > +test_expect_merge_algorithm failure success 'check conflictin...
> > +test_expect_merge_algorithm failure success 'rad-check: renam...
> > +test_expect_merge_algorithm failure success 'rrdd-check: rena...
> > +test_expect_merge_algorithm failure success 'mod6-check: chai...
> > +test_expect_merge_algorithm failure success '6b1: Same rename...
> > +test_expect_merge_algorithm failure success '6b2: Same rename...
> > +test_expect_merge_algorithm failure success '10e: Does git co...
> > +test_expect_merge_algorithm failure success '12b1: Moving two...
> > +test_expect_merge_algorithm failure success '12c1: Moving one...
> > +test_expect_merge_algorithm failure success '12f: Trivial dir...
> > +test_expect_merge_algorithm failure success '4a: Change on A,...
> > +test_expect_merge_algorithm failure success 'merge-recursive ...
:-)
Previous: Junio C HamanoNext: Elijah Newren
Message 7 of 31 in “Support both merge backends in the testsuite, via environment variable”
  1. 0/9 Support both merge backends in the testsuite, via environment variableElijah Newren via GitGitGadget, Oct 23, 2020
  2. 2/9 merge tests: expect improved directory/file conflict handling in ortElijah Newren via GitGitGadget, Oct 23, 2020
  3. Elijah NewrenOct 23, 2020
  4. 3/9 t6416: correct expectation for rename/rename(1to2) + directory/fileElijah Newren via GitGitGadget, Oct 23, 2020
  5. 1/9 t/: new helper for tests that pass with ort but fail with recursiveElijah Newren via GitGitGadget, Oct 23, 2020
  6. Junio C HamanoOct 23, 2020
  7. Elijah NewrenOct 23, 2020
  8. Elijah NewrenOct 23, 2020
  9. Đoàn Trần Công DanhOct 24, 2020
  10. Elijah NewrenOct 24, 2020
  11. Đoàn Trần Công DanhOct 25, 2020
  12. Elijah NewrenOct 26, 2020
  13. Junio C HamanoOct 26, 2020
  14. 4/9 t6404, t6423: expect improved rename/delete handling in ort backendElijah Newren via GitGitGadget, Oct 23, 2020
  15. 5/9 t6423: expect improved conflict markers labels in the ort backendElijah Newren via GitGitGadget, Oct 23, 2020
  16. 6/9 merge tests: expect slight differences in output for recursive vs. ortElijah Newren via GitGitGadget, Oct 23, 2020
  17. Elijah NewrenOct 24, 2020
  18. 9/9 t6423: add more details about direct resolution of directoriesElijah Newren via GitGitGadget, Oct 23, 2020
  19. Elijah NewrenOct 23, 2020
  20. 7/9 t6423, t6436: note improved ort handling with dirty filesElijah Newren via GitGitGadget, Oct 23, 2020
  21. 8/9 t6423: note improved ort handling with untracked filesElijah Newren via GitGitGadget, Oct 23, 2020
  22. 0/9 Support both merge backends in the testsuite, via environment variableElijah Newren via GitGitGadget, Oct 26, 2020
  23. 7/9 t6423, t6436: note improved ort handling with dirty filesElijah Newren via GitGitGadget, Oct 26, 2020
  24. 9/9 t6423: add more details about direct resolution of directoriesElijah Newren via GitGitGadget, Oct 26, 2020
  25. 8/9 t6423: note improved ort handling with untracked filesElijah Newren via GitGitGadget, Oct 26, 2020
  26. 6/9 merge tests: expect slight differences in output for recursive vs. ortElijah Newren via GitGitGadget, Oct 26, 2020
  27. 5/9 t6423: expect improved conflict markers labels in the ort backendElijah Newren via GitGitGadget, Oct 26, 2020
  28. 4/9 t6404, t6423: expect improved rename/delete handling in ort backendElijah Newren via GitGitGadget, Oct 26, 2020
  29. 2/9 merge tests: expect improved directory/file conflict handling in ortElijah Newren via GitGitGadget, Oct 26, 2020
  30. 1/9 t/: new helper for tests that pass with ort but fail with recursiveElijah Newren via GitGitGadget, Oct 26, 2020
  31. 3/9 t6416: correct expectation for rename/rename(1to2) + directory/fileElijah Newren via GitGitGadget, Oct 26, 2020

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.