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

Re: [PATCH v2 1/6] t1300: make tests more robust with non-default ref backends

From
Justin Tobler <jltobler@gmail.com>
Date
Jan 23, 2024, 16:43 UTC
Message-ID
<CAGAWz+43bjotkJ3UxGgsageYuWt4g=95uBM-sy4dqyBVCJLToA@mail.gmail.com>
In-Reply-To
<Za_ZrtRMEmVHu_o5@tanuki>
On Tue, Jan 23, 2024 at 9:22 AM Patrick Steinhardt <ps@pks.im> wrote:
Show 50 quoted lines
>
> On Tue, Jan 23, 2024 at 02:41:17PM +0100, Toon Claes wrote:
> >
> > Patrick Steinhardt <ps@pks.im> writes:
> >
> > > [[PGP Signed Part:Undecided]]
> > > [1. text/plain]
> > > The t1300 test suite exercises the git-config(1) tool. To do so we
> > > overwrite ".git/config" to contain custom contents. While this is easy
> > > enough to do, it may create problems when using a non-default repository
> > > format because we also overwrite the repository format version as well
> > > as any potential extensions. With the upcoming "reftable" ref backend
> > > the result is that we may try to access refs via the "files" backend
> > > even though the repository has been initialized with the "reftable"
> > > backend.
> > >
> > > Refactor tests which access the refdb to be more robust by using their
> > > own separate repositories, which allows us to be more careful and not
> > > discard required extensions.
> > >
> > > Signed-off-by: Patrick Steinhardt <ps@pks.im>
> > > ---
> >
> > > @@ -2009,11 +2020,11 @@ test_expect_success '--show-origin getting a single key' '
> > >  '
> > >
> > >  test_expect_success 'set up custom config file' '
> > > -   CUSTOM_CONFIG_FILE="custom.conf" &&
> > > -   cat >"$CUSTOM_CONFIG_FILE" <<-\EOF
> > > +   cat >"custom.conf" <<-\EOF &&
> > >     [user]
> > >             custom = true
> > >     EOF
> > > +   CUSTOM_CONFIG_FILE="$(test-tool path-utils real_path
> > >  custom.conf)"
> > >  '
> >
> > From the commit message it was not clear to me this change was needed.
> > Do you think it's worth it to add something to the commit message
> > explaining you now need to copy the custom.conf into each seperate
> > repository?
>
> Good point in fact. The problem here is that before, CUSTOM_CONFIG_FILE
> was using a relative path that wouldn't be found when cd'ing into the
> respective subrepositories. By using `path-utils real_path` we resolve
> the relative path to the full path, and thus we can find the file
> regardless of our shell's current working directory.
>
> Not sure whether this is worth a reroll, but in case you or others think
> that it is then I'm happy to add this explanation.

I also found it unclear why the CUSTOM_CONFIG_FILE change was needed. I had assumed it was a refactor to make the tests more robust. It might be nice to explain it in the commit message. :)

-Justin
Previous: Patrick SteinhardtNext: Christian Couder
Message 23 of 54 in “t: mark "files"-backend specific tests”
  1. 0/6 t: mark "files"-backend specific testsPatrick Steinhardt, Jan 9, 2024
  2. 1/6 t1300: mark tests to require default repo formatPatrick Steinhardt, Jan 9, 2024
  3. Taylor BlauJan 9, 2024
  4. Patrick SteinhardtJan 10, 2024
  5. Eric SunshineJan 9, 2024
  6. Patrick SteinhardtJan 10, 2024
  7. 2/6 t1301: mark test for `core.sharedRepository` as reffiles specificPatrick Steinhardt, Jan 9, 2024
  8. 3/6 t1302: make tests more robust with new extensionsPatrick Steinhardt, Jan 9, 2024
  9. Taylor BlauJan 9, 2024
  10. 4/6 t1419: mark test suite as files-backend specificPatrick Steinhardt, Jan 9, 2024
  11. Eric SunshineJan 9, 2024
  12. Patrick SteinhardtJan 10, 2024
  13. Junio C HamanoJan 10, 2024
  14. Patrick SteinhardtJan 11, 2024
  15. 5/6 t5526: break test submodule differentlyPatrick Steinhardt, Jan 9, 2024
  16. Eric SunshineJan 9, 2024
  17. Patrick SteinhardtJan 10, 2024
  18. 6/6 t: mark tests regarding git-pack-refs(1) to be backend specificPatrick Steinhardt, Jan 9, 2024
  19. 0/6 t: mark "files"-backend specific testsPatrick Steinhardt, Jan 10, 2024
  20. 1/6 t1300: make tests more robust with non-default ref backendsPatrick Steinhardt, Jan 10, 2024
  21. Toon ClaesJan 23, 2024
  22. Patrick SteinhardtJan 23, 2024
  23. Justin ToblerJan 23, 2024
  24. Christian CouderJan 23, 2024
  25. Patrick SteinhardtJan 24, 2024
  26. Christian CouderJan 29, 2024
  27. Patrick SteinhardtJan 29, 2024
  28. 2/6 t1301: mark test for `core.sharedRepository` as reffiles specificPatrick Steinhardt, Jan 10, 2024
  29. 3/6 t1302: make tests more robust with new extensionsPatrick Steinhardt, Jan 10, 2024
  30. Toon ClaesJan 23, 2024
  31. Patrick SteinhardtJan 23, 2024
  32. Christian CouderJan 23, 2024
  33. Patrick SteinhardtJan 24, 2024
  34. 4/6 t1419: mark test suite as files-backend specificPatrick Steinhardt, Jan 10, 2024
  35. 5/6 t5526: break test submodule differentlyPatrick Steinhardt, Jan 10, 2024
  36. 6/6 t: mark tests regarding git-pack-refs(1) to be backend specificPatrick Steinhardt, Jan 10, 2024
  37. Christian CouderJan 23, 2024
  38. 0/6 t: mark "files"-backend specific testsPatrick Steinhardt, Jan 24, 2024
  39. 1/6 t1300: make tests more robust with non-default ref backendsPatrick Steinhardt, Jan 24, 2024
  40. 2/6 t1301: mark test for `core.sharedRepository` as reffiles specificPatrick Steinhardt, Jan 24, 2024
  41. 3/6 t1302: make tests more robust with new extensionsPatrick Steinhardt, Jan 24, 2024
  42. 4/6 t1419: mark test suite as files-backend specificPatrick Steinhardt, Jan 24, 2024
  43. 5/6 t5526: break test submodule differentlyPatrick Steinhardt, Jan 24, 2024
  44. 6/6 t: mark tests regarding git-pack-refs(1) to be backend specificPatrick Steinhardt, Jan 24, 2024
  45. 0/6 t: mark "files"-backend specific testsPatrick Steinhardt, Jan 29, 2024
  46. 1/6 t1300: make tests more robust with non-default ref backendsPatrick Steinhardt, Jan 29, 2024
  47. Christian CouderJan 29, 2024
  48. 2/6 t1301: mark test for `core.sharedRepository` as reffiles specificPatrick Steinhardt, Jan 29, 2024
  49. 3/6 t1302: make tests more robust with new extensionsPatrick Steinhardt, Jan 29, 2024
  50. 4/6 t1419: mark test suite as files-backend specificPatrick Steinhardt, Jan 29, 2024
  51. 5/6 t5526: break test submodule differentlyPatrick Steinhardt, Jan 29, 2024
  52. 6/6 t: mark tests regarding git-pack-refs(1) to be backend specificPatrick Steinhardt, Jan 29, 2024
  53. Christian CouderJan 29, 2024
  54. Junio C HamanoJan 29, 2024

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.