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

Re: [GSoC][PATCH v5 0/7] t: port reftable/pq_test.c to the unit testing framework

From
CPChandra Pratap <chandrapratap3519@gmail.com>
Date
Jul 24, 2024, 05:12 UTC
Message-ID
<CA+J6zkRKzQGvwhiQdgRqcctDP76y5_v582rRTzEXJyx7=+WRqw@mail.gmail.com>
In-Reply-To
<xmqq5xsw2fyd.fsf@gitster.g>
On Tue, 23 Jul 2024 at 22:39, Junio C Hamano <gitster@pobox.com> wrote:
Show 43 quoted lines
>
> Chandra Pratap <chandrapratap3519@gmail.com> writes:
>
> > The reftable library comes with self tests, which are exercised
> > as part of the usual end-to-end tests and are designed to
> > observe the end-user visible effects of Git commands. What it
> > exercises, however, is a better match for the unit-testing
> > framework, merged at 8bf6fbd0 (Merge branch 'js/doc-unit-tests',
> > 2023-12-09), which is designed to observe how low level
> > implementation details, at the level of sequences of individual
> > function calls, behave.
> >
> > Hence, port reftable/pq_test.c to the unit testing framework and
> > improve upon the ported test. The first two patches in the series
> > are preparatory cleanup, the third patch moves the test to the unit
> > testing framework, and the rest of the patches improve upon the
> > ported test.
> >
> > Mentored-by: Patrick Steinhardt <ps@pks.im>
> > Mentored-by: Christian Couder <chriscool@tuxfamily.org>
> > Signed-off-by: Chandra Pratap <chandrapratap3519@gmail.com>
> >
> > ---
> > Changes in v5:
> > - Rebase the branch on top of the  latest master branch
>
> If you need to perform this rebase, please say _why_ you are
> rebasing.
>
> "A new rc was tagged so I rebased" is *not* a good reason.
>
> "I wanted to use that new feature that was merged to 'master'
> recently, which was not available when I wrote the previous
> iteration of this series, hence I rebased" is a very good reason.
>
> "Since I wrote the previous iteration, other unit test topics have
> graduated, so there are trivial conflicts in Makefile when merging
> this topic" is usually not a good reason, especially when the same
> conflicts with these other unit test topics are already resolved
> when your previous iteration is merged to 'seen'.
>
> If there isn't a reason worth mentioning why you are rebasing, then
> please do not rebase.  It is distracting.
Oh, okay.
Show 16 quoted lines
> > - Rename tests according to unit-tests' conventions
> > - remove 'pq_test_main()' from reftable/reftable-test.h
> >
> > CI/PR for v5: https://github.com/gitgitgadget/git/pull/1745
>
> By the way, I still haven't got any answer to a question I asked
> long ago on this series, wrt possibly unifying this pq and another
> pq we already use elsewhere in our codebase.  If we are butchering
> what we borrowed from elsewhere and store in reftable/. directory
> and taking responsibility of maintaining it ourselves, we probably
> should consider larger refactoring and cleaning up, and part of it
> we may end up discarding this pq implementation, making the unit
> testing on it a wasted effort.
>
> Thanks.
>

I did talk about this with Patrick and Christian on a private slack channel a few weeks ago and here is how that conversation went:

Me: Hey, I wanted to talk about the message from Junio the other day.
It is true that through this project, we are modifying the reftable directory
to a point that it is no longer easily usable by someone from outside. If
that is the direction we want to take, wouldn't it make more sense to get
rid of reftable/pq.{c, h} altogether and use Git's prio-queue instead?
Christian: Yeah, I think the direction the Git project wants to take is to
integrate the reftable code more and more with the Git code. On the other
hand, there are libification projects which are trying to split parts of the
Git code into libraries usable by other projects. But I don't think each of
these libraries should have their own test framework, their own prio-queue
implementation, their own string implementation, etc. So, even if I am not
sure about the end result, I think it would be ok to modify the reftable code
so that it uses the Git's prio queue and maybe other Git data structures.
But I'd like Patrick to confirm, and the list to agree to this. So I'd
rather wait
until Patrick is back from his vacation before doing things like replacing
reftable/pq.{c, h} with Git's prio-queue.
Patrick: Just chiming in real quick: while the reftable library is
currently in a
position where it cannot be used standalone by other projects, I'd very much
like to move into the direction of making it completely standalone again so
that we can adapt e.g. libgit2 to use it. So I rather want to move the other
direction over time and re-establish a proper boundary between reftable
library and the remainder of Git. I don't really think that this needs to impact
the reftable tests though. Git is the upstream of the reftable
library, and I don't
see much of a point why every other project should carry the same tests, too.
---snip---
Previous: Junio C HamanoNext: Christian Couder
Message 53 of 78 in “t: port reftable/pq_test.c to the unit testing”
  1. Chandra PratapJun 6, 2024
  2. [GSoC][PATCH 1/6] reftable: clean up reftable/pq.cChandra Pratap, Jun 6, 2024
  3. Christian CouderJun 6, 2024
  4. Chandra PratapJun 6, 2024
  5. Christian CouderJun 6, 2024
  6. [GSoC][PATCH 2/6] t: move reftable/pq_test.c to the unit testing frameworkChandra Pratap, Jun 6, 2024
  7. Patrick SteinhardtJun 6, 2024
  8. [GSoC][PATCH 3/6] t-reftable-pq: make merged_iter_pqueue_check() staticChandra Pratap, Jun 6, 2024
  9. [GSoC][PATCH 4/6] t-reftable-pq: make merged_iter_pqueue_check() callable by referenceChandra Pratap, Jun 6, 2024
  10. Patrick SteinhardtJun 6, 2024
  11. [GSoC][PATCH 5/6] t-reftable-pq: add test for index based comparisonChandra Pratap, Jun 6, 2024
  12. Patrick SteinhardtJun 6, 2024
  13. [GSoC][PATCH 6/6] t-reftable-pq: add tests for merged_iter_pqueue_top()Chandra Pratap, Jun 6, 2024
  14. Patrick SteinhardtJun 6, 2024
  15. [GSoC][PATCH v2 0/6] t: port reftable/pq_test.c to the unit testingChandra Pratap, Jun 6, 2024
  16. [GSoC][PATCH v2 1/6] reftable: clean up reftable/pq.cChandra Pratap, Jun 6, 2024
  17. Patrick SteinhardtJun 10, 2024
  18. [GSoC][PATCH v2 2/6] t: move reftable/pq_test.c to the unit testing frameworkChandra Pratap, Jun 6, 2024
  19. [GSoC][PATCH v2 3/6] t-reftable-pq: make merged_iter_pqueue_check() staticChandra Pratap, Jun 6, 2024
  20. [GSoC][PATCH v2 4/6] t-reftable-pq: make merged_iter_pqueue_check() callable by referenceChandra Pratap, Jun 6, 2024
  21. [GSoC][PATCH v2 5/6] t-reftable-pq: add test for index based comparisonChandra Pratap, Jun 6, 2024
  22. [GSoC][PATCH v2 6/6] t-reftable-pq: add tests for merged_iter_pqueue_top()Chandra Pratap, Jun 6, 2024
  23. [GSoC][PATCH v3 0/7] t: port reftable/pq_test.c to the unit testing frameworkChandra Pratap, Jun 11, 2024
  24. 1/7 reftable: remove unncessary curly braces in reftable/pq.cChandra Pratap, Jun 11, 2024
  25. 2/7 reftable: change the type of array indices to 'size_t' in reftable/pq.cChandra Pratap, Jun 11, 2024
  26. Patrick SteinhardtJun 11, 2024
  27. 3/7 t: move reftable/pq_test.c to the unit testing frameworkChandra Pratap, Jun 11, 2024
  28. 4/7 t-reftable-pq: make merged_iter_pqueue_check() staticChandra Pratap, Jun 11, 2024
  29. 5/7 t-reftable-pq: make merged_iter_pqueue_check() callable by referenceChandra Pratap, Jun 11, 2024
  30. 6/7 t-reftable-pq: add test for index based comparisonChandra Pratap, Jun 11, 2024
  31. 7/7 t-reftable-pq: add tests for merged_iter_pqueue_top()Chandra Pratap, Jun 11, 2024
  32. [GSoC][PATCH v4 0/7] t: port reftable/pq_test.c to the unit testing frameworkChandra Pratap, Jun 14, 2024
  33. 1/7 reftable: remove unncessary curly braces in reftable/pq.cChandra Pratap, Jun 14, 2024
  34. 2/7 reftable: change the type of array indices to 'size_t' in reftable/pq.cChandra Pratap, Jun 14, 2024
  35. 3/7 t: move reftable/pq_test.c to the unit testing frameworkChandra Pratap, Jun 14, 2024
  36. 4/7 t-reftable-pq: make merged_iter_pqueue_check() staticChandra Pratap, Jun 14, 2024
  37. 5/7 t-reftable-pq: make merged_iter_pqueue_check() callable by referenceChandra Pratap, Jun 14, 2024
  38. 6/7 t-reftable-pq: add test for index based comparisonChandra Pratap, Jun 14, 2024
  39. 7/7 t-reftable-pq: add tests for merged_iter_pqueue_top()Chandra Pratap, Jun 14, 2024
  40. Junio C HamanoJun 14, 2024
  41. [GSoC][PATCH v5 0/7] t: port reftable/pq_test.c to the unit testing frameworkChandra Pratap, Jul 23, 2024
  42. 1/7 reftable: remove unncessary curly braces in reftable/pq.cChandra Pratap, Jul 23, 2024
  43. 2/7 reftable: change the type of array indices to 'size_t' in reftable/pq.cChandra Pratap, Jul 23, 2024
  44. 3/7 t: move reftable/pq_test.c to the unit testing frameworkChandra Pratap, Jul 23, 2024
  45. 4/7 t-reftable-pq: make merged_iter_pqueue_check() staticChandra Pratap, Jul 23, 2024
  46. 5/7 t-reftable-pq: make merged_iter_pqueue_check() callable by referenceChandra Pratap, Jul 23, 2024
  47. 6/7 t-reftable-pq: add test for index based comparisonChandra Pratap, Jul 23, 2024
  48. Patrick SteinhardtJul 24, 2024
  49. Junio C HamanoJul 24, 2024
  50. Patrick SteinhardtJul 25, 2024
  51. 7/7 t-reftable-pq: add tests for merged_iter_pqueue_top()Chandra Pratap, Jul 23, 2024
  52. Junio C HamanoJul 23, 2024
  53. Chandra PratapJul 24, 2024
  54. Christian CouderJul 24, 2024
  55. Chandra PratapJul 24, 2024
  56. Patrick SteinhardtJul 24, 2024
  57. Junio C HamanoJul 24, 2024
  58. [GSoC][PATCH v6 0/7] t: port reftable/pq_test.c to the unit testing frameworkChandra Pratap, Jul 25, 2024
  59. 1/7 reftable: remove unncessary curly braces in reftable/pq.cChandra Pratap, Jul 25, 2024
  60. Kristoffer HaugsbakkJul 25, 2024
  61. 2/7 reftable: change the type of array indices to 'size_t' in reftable/pq.cChandra Pratap, Jul 25, 2024
  62. 3/7 t: move reftable/pq_test.c to the unit testing frameworkChandra Pratap, Jul 25, 2024
  63. 4/7 t-reftable-pq: make merged_iter_pqueue_check() staticChandra Pratap, Jul 25, 2024
  64. 5/7 t-reftable-pq: make merged_iter_pqueue_check() callable by referenceChandra Pratap, Jul 25, 2024
  65. 6/7 t-reftable-pq: add test for index based comparisonChandra Pratap, Jul 25, 2024
  66. Patrick SteinhardtJul 30, 2024
  67. 7/7 t-reftable-pq: add tests for merged_iter_pqueue_top()Chandra Pratap, Jul 25, 2024
  68. Patrick SteinhardtJul 30, 2024
  69. [GSoC][PATCH v7 0/7] t: port reftable/pq_test.c to the unit testing frameworkChandra Pratap, Aug 1, 2024
  70. 1/7 reftable: remove unnecessary curly braces in reftable/pq.cChandra Pratap, Aug 1, 2024
  71. 2/7 reftable: change the type of array indices to 'size_t' in reftable/pq.cChandra Pratap, Aug 1, 2024
  72. 3/7 t: move reftable/pq_test.c to the unit testing frameworkChandra Pratap, Aug 1, 2024
  73. 4/7 t-reftable-pq: make merged_iter_pqueue_check() staticChandra Pratap, Aug 1, 2024
  74. 5/7 t-reftable-pq: make merged_iter_pqueue_check() callable by referenceChandra Pratap, Aug 1, 2024
  75. 6/7 t-reftable-pq: add test for index based comparisonChandra Pratap, Aug 1, 2024
  76. 7/7 t-reftable-pq: add tests for merged_iter_pqueue_top()Chandra Pratap, Aug 1, 2024
  77. Patrick SteinhardtAug 1, 2024
  78. Junio C HamanoAug 1, 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.