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

Re: [PATCH 2/2] test-lib: GIT_TEST_ONLY to run only specific tests

From
IBIlya Bobyr <ilya.bobir@gmail.com>
Date
Mar 4, 2014, 07:06 UTC
Message-ID
<53157B72.3000205@gmail.com>
In-Reply-To
<xmqq4n3en7un.fsf@gitster.dls.corp.google.com>
On 3/3/2014 4:08 PM, Junio C Hamano wrote:
Show 5 quoted lines
> Ilya Bobyr <ilya.bobir@gmail.com> writes:
>
>> It might be that we are looking at different use cases, as you are
>> talking about whole test suits.
> I do not think so.

Good :) I am trying to understand the use cases. And make sure we are talking about the same ones. I am not sure what are the use cases for GIT_SKIP_TESTS.

I think that while in it really nice when an interface allows to do new things, the main use case (or use cases) should be as easy and obvious in the first place. If the target is the TDD use case I described, then it appears that a user needs to do double negation. That is what concerns me.

Show 7 quoted lines
> I do not see anything prevents you from saying
>
> 	GIT_SKIP_TESTS='t0000 !t0000.1 !t0000.4'
>
> to specify test-pieces in individual tests so that you can run the
> setup step (step .1) and the specific test (step .4) without running
> two tests in between.
While it could be done, it looks less obvious than this:
     GIT_TEST_ONLY='1 4' ./t0001-init.sh

What if we do what you proposed, but with GIT_RUN_TESTS? If we want to have one interface, maybe, building on top of a "negation" (GIT_SKIP_TESTS) is not very good. At the same time, GIT_TEST_ONLY is also too specific for a generic interface. I could add GIT_RUN_TESTS and allow it to have all of the features, thus making GIT_SKIP_TESTS a working but deprecated tool.

Running specific tests:
     GIT_RUN_TESTS='t0000'
     GIT_RUN_TESTS='t0000.1 t0002'
     GIT_RUN_TESTS='1 3 7'
Negating some tests:
     GIT_RUN_TESTS='!t0000'
     GIT_RUN_TESTS='!t0000.1'
     GIT_RUN_TESTS='!1 !3 !7'

The above would work exactly as you described but with one less level of negation. Default is everything, unless at least one positive pattern is given.

Later on range specification could added:
     GIT_RUN_TESTS='<11'

At least for now that would cover most use cases that I can think of that look reasonable.

Previous: Junio C HamanoNext: Junio C Hamano
Message 9 of 17 in “test-lib: tests skipped by GIT_SKIP_TESTS say so”
  1. 1/2 test-lib: tests skipped by GIT_SKIP_TESTS say soIlya Bobyr, Mar 3, 2014
  2. 2/2 test-lib: GIT_TEST_ONLY to run only specific testsIlya Bobyr, Mar 3, 2014
  3. Philip OakleyMar 3, 2014
  4. Eric SunshineMar 3, 2014
  5. Ilya BobyrMar 3, 2014
  6. Junio C HamanoMar 3, 2014
  7. Ilya BobyrMar 3, 2014
  8. Junio C HamanoMar 4, 2014
  9. Ilya BobyrMar 4, 2014
  10. Junio C HamanoMar 4, 2014
  11. Ilya BobyrMar 4, 2014
  12. Junio C HamanoMar 4, 2014
  13. Philip OakleyMar 3, 2014
  14. Ilya BobyrMar 3, 2014
  15. Eric SunshineMar 3, 2014
  16. Ilya BobyrMar 3, 2014
  17. Junio C HamanoMar 3, 2014

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.