mbox series

[0/8] test-lib tests: split off subtest code in t0000 into lib-subtest.sh

Message ID cover-0.8-00000000000-20210614T104351Z-avarab@gmail.com (mailing list archive)
Headers show
Series test-lib tests: split off subtest code in t0000 into lib-subtest.sh | expand

Message

Ævar Arnfjörð Bjarmason June 14, 2021, 10:48 a.m. UTC
This refactors the testing of test-lib.sh itself in t0000 into a
lib-subtest.sh, fixing duplicate setup, bugs and various shell nits
along the way.

This was waiting on my now-merged 2019256717d (Merge branch
'ab/test-lib-updates', 2021-06-14).

There's a conflict here with Felipe's proposed
http://lore.kernel.org/git/20210609170520.67014-1-felipe.contreras@gmail.com,
but it's just a matter of moving the fix around and solving a trivial
conflict. I thought it was better to submit this now anyway, while
this code is fresh in people's minds.

I'm hoping Felipe will take some variant of my
http://lore.kernel.org/git/8735tk22if.fsf@evledraar.gmail.com and
perhaps review this series & base his patch on top of these changes,
but alternatively they can go in independently with Junio solving the
conflict.

Ævar Arnfjörð Bjarmason (8):
  test-lib tests: move "run_sub_test" to a new lib-subtest.sh
  test-lib tests: split up "write and run" into two functions
  test-lib tests: stop using a subshell in write_sub_test_lib_test()
  test-lib tests: don't provide a description for the sub-tests
  test-lib tests: get rid of copy/pasted mock test code
  test-lib tests: avoid subshell for "test_cmp" for readability
  test-lib tests: refactor common part of check_sub_test_lib_test*()
  test-lib tests: assert 1 exit code, not non-zero

 t/lib-subtest.sh | 105 ++++++++++++
 t/t0000-basic.sh | 419 +++++++++++++----------------------------------
 2 files changed, 219 insertions(+), 305 deletions(-)
 create mode 100644 t/lib-subtest.sh

Comments

Junio C Hamano June 15, 2021, 2:24 a.m. UTC | #1
Ævar Arnfjörð Bjarmason  <avarab@gmail.com> writes:

> This refactors the testing of test-lib.sh itself in t0000 into a
> lib-subtest.sh, fixing duplicate setup, bugs and various shell nits
> along the way.
> ...
> I thought it was better to submit this now anyway, while
> this code is fresh in people's minds.

Any time you send it anew is the time it is fresh in people's minds
if they read it, no?  I am not sure I understand the reasoning.

> I'm hoping Felipe will take some variant of my
> http://lore.kernel.org/git/8735tk22if.fsf@evledraar.gmail.com and
> perhaps review this series & base his patch on top of these changes,
> but alternatively they can go in independently with Junio solving the
> conflict.

I'd rather not if it can be avoided.  Please scale the process by
coordinating among contributors yourselves.
Felipe Contreras June 15, 2021, 6:05 p.m. UTC | #2
Ævar Arnfjörð Bjarmason wrote:

> There's a conflict here with Felipe's proposed
> http://lore.kernel.org/git/20210609170520.67014-1-felipe.contreras@gmail.com,
> but it's just a matter of moving the fix around and solving a trivial
> conflict. I thought it was better to submit this now anyway, while
> this code is fresh in people's minds.
> 
> I'm hoping Felipe will take some variant of my
> http://lore.kernel.org/git/8735tk22if.fsf@evledraar.gmail.com and
> perhaps review this series & base his patch on top of these changes,
> but alternatively they can go in independently with Junio solving the
> conflict.

I have no problem rebasing my patch on top of your series, but my
current v2 doesn't touch _run_sub_test_lib_test_common at all, and I'm
not sure your proposal of TEST_NO_RESULTS_OUTPUT is the way to go, so
perhaps there's no need to rebase at all.

Unless there's something on this series that would help
TEST_OUTPUT_DIRECTORY, which at a quick glance doesn't seem to be the
case.

Cheers.
Ævar Arnfjörð Bjarmason June 24, 2021, 10:38 a.m. UTC | #3
On Tue, Jun 15 2021, Junio C Hamano wrote:

> Ævar Arnfjörð Bjarmason  <avarab@gmail.com> writes:
>
>> This refactors the testing of test-lib.sh itself in t0000 into a
>> lib-subtest.sh, fixing duplicate setup, bugs and various shell nits
>> along the way.
>> ...
>> I thought it was better to submit this now anyway, while
>> this code is fresh in people's minds.
>
> Any time you send it anew is the time it is fresh in people's minds
> if they read it, no?  I am not sure I understand the reasoning.
>
>> I'm hoping Felipe will take some variant of my
>> http://lore.kernel.org/git/8735tk22if.fsf@evledraar.gmail.com and
>> perhaps review this series & base his patch on top of these changes,
>> but alternatively they can go in independently with Junio solving the
>> conflict.
>
> I'd rather not if it can be avoided.  Please scale the process by
> coordinating among contributors yourselves.

Per Felipe's reply and his
https://lore.kernel.org/git/20210615183157.104999-1-felipe.contreras@gmail.com/
I don't think there's any conflict anymore, so this series should apply
on master without any conflicts.

It would be great to have it picked up, it's another set of test
cleanups I need for a subsequent series...
Ævar Arnfjörð Bjarmason June 30, 2021, 7:04 a.m. UTC | #4
On Thu, Jun 24 2021, Ævar Arnfjörð Bjarmason wrote:

> On Tue, Jun 15 2021, Junio C Hamano wrote:
>
>> Ævar Arnfjörð Bjarmason  <avarab@gmail.com> writes:
>>
>>> This refactors the testing of test-lib.sh itself in t0000 into a
>>> lib-subtest.sh, fixing duplicate setup, bugs and various shell nits
>>> along the way.
>>> ...
>>> I thought it was better to submit this now anyway, while
>>> this code is fresh in people's minds.
>>
>> Any time you send it anew is the time it is fresh in people's minds
>> if they read it, no?  I am not sure I understand the reasoning.
>>
>>> I'm hoping Felipe will take some variant of my
>>> http://lore.kernel.org/git/8735tk22if.fsf@evledraar.gmail.com and
>>> perhaps review this series & base his patch on top of these changes,
>>> but alternatively they can go in independently with Junio solving the
>>> conflict.
>>
>> I'd rather not if it can be avoided.  Please scale the process by
>> coordinating among contributors yourselves.
>
> Per Felipe's reply and his
> https://lore.kernel.org/git/20210615183157.104999-1-felipe.contreras@gmail.com/
> I don't think there's any conflict anymore, so this series should apply
> on master without any conflicts.
>
> It would be great to have it picked up, it's another set of test
> cleanups I need for a subsequent series...

Junio, just a reminder about this series: It has no conflicts with
"seen", and that WIP patch it would have conflicted with it was replaced
by another approach.

I've got some other non-testing changes queued on top of this, it would
be great to have it picked up. Thanks!
Junio C Hamano July 1, 2021, 2:30 p.m. UTC | #5
Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:

> On Thu, Jun 24 2021, Ævar Arnfjörð Bjarmason wrote:
>
>> On Tue, Jun 15 2021, Junio C Hamano wrote:
>>
>>> Ævar Arnfjörð Bjarmason  <avarab@gmail.com> writes:
>>>
>>>> This refactors the testing of test-lib.sh itself in t0000 into a
>>>> lib-subtest.sh, fixing duplicate setup, bugs and various shell nits
>>>> along the way.
> ...
> Junio, just a reminder about this series: It has no conflicts with
> "seen", and that WIP patch it would have conflicted with it was replaced
> by another approach.

https://lore.kernel.org/git/cover-0.8-00000000000-20210614T104351Z-avarab@gmail.com/
reveals that this hasn't seen much reviews, though.  I'll try to
find time to read it through; no promises if it will be done by the
end of the week, though.

Thanks.