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

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

From
Junio C Hamano <gitster@pobox.com>
Date
Jun 14, 2024, 17:40 UTC
Message-ID
<xmqqo783fmo9.fsf@gitster.g>
In-Reply-To
<20240614095136.12052-1-chandrapratap3519@gmail.com>
Chandra Pratap <chandrapratap3519@gmail.com> writes:
Show 21 quoted lines
> In the recent codebase update (commit 8bf6fbd, 2023-12-09), a new unit
> testing framework written entirely in C was introduced to the Git project
> aimed at simplifying testing and reducing test run times.
> Currently, tests for the reftable refs-backend are performed by a custom
> testing framework defined by reftable/test_framework.{c, h}. 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 v4:
> - Add a commit message for the second patch
>
> CI/PR for v4: https://github.com/gitgitgadget/git/pull/1745
Hmph.

A larger question is how pristine we want to keep the "imported source" that is reftable/* stuff.

Obviously we are getting rid of some parts of it (like pq_test.c here) so our "fork" will no longer be usable, without pulling some of the stuff our project offers from outside that directory, by outside people. This concern is shared with other topics we saw recently to move the unit tests bundled with the reftable library to t/unit-tests/.

But this series brings in another twist that makes it a larger question. If we are willing to butcher our copy of reftable library to a shape that cannot be reused by outside folks, do we still want to use reftable/pq.c instead of getting rid of it and use the other prio queue implementation we use elsewhere in our system? If that will be the longer term direction we want to go, then porting the unit tests for reftable/pq.c may end up being a wasted effort.

So, I dunno.
Show 37 quoted lines
> Chandra Pratap(7):
> reftable: remove unncessary curly braces in reftable/pq.c
> reftable: change the type of array indices to 'size_t' in
> t: move reftable/pq_test.c to the unit testing framework
> t-reftable-pq: make merged_iter_pqueue_check() static
> t-reftable-pq: make merged_iter_pqueue_check() callable
> t-reftable-pq: add test for index based comparison
> t-reftable-pq: add tests for merged_iter_pqueue_top()
>
> Makefile                     |   2 +-
> reftable/pq.c                |  29 +++--------
> reftable/pq.h                |   1 -
> reftable/pq_test.c           |  74 ----------------------------
> t/helper/test-reftable.c     |   1 -
> t/unit-tests/t-reftable-pq.c | 155 +++++++++++++++++++++++++++++++++++++++++++++
> 6 files changed, 166 insertions(+), 96 deletions(-)
>
> Range-diff against v3:
> 1:  3c333e7770 ! 1:  1873fb02ce reftable: change the type of array indices to 'size_t' in reftable/pq.c
>     @@ Metadata
>       ## Commit message ##
>          reftable: change the type of array indices to 'size_t' in reftable/pq.c
>      
>     +    The variables 'i', 'j', 'k' and 'min' are used as indices for
>     +    'pq->heap', which is an array. Additionally, 'pq->len' is of
>     +    type 'size_t' and is often used to assign values to these
>     +    variables. Hence, change the type of these variables from 'int'
>     +    to 'size_t'.
>     +
>          Mentored-by: Patrick Steinhardt <ps@pks.im>
>          Mentored-by: Christian Couder <chriscool@tuxfamily.org>
>          Signed-off-by: Chandra Pratap <chandrapratap3519@gmail.com>
> 2:  bf547f705a = 2:  3cccf8266a t: move reftable/pq_test.c to the unit testing framework
> 3:  7dd3a2b27f = 3:  4b63849694 t-reftable-pq: make merged_iter_pqueue_check() static
> 4:  c803e7adfc = 4:  3698a7189f t-reftable-pq: make merged_iter_pqueue_check() callable by reference
> 5:  0b03f3567d = 5:  d58c8f709e t-reftable-pq: add test for index based comparison
> 6:  0cdfa6221e = 6:  69521f0ff7 t-reftable-pq: add tests for merged_iter_pqueue_top()
Previous: Chandra PratapNext: Chandra Pratap
Message 40 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.