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
Junio C Hamano <gitster@pobox.com>
Date
Mar 4, 2014, 19:01 UTC
Message-ID
<xmqq1tyhlrds.fsf@gitster.dls.corp.google.com>
In-Reply-To
<53159A55.70105@gmail.com>
Ilya Bobyr <ilya.bobir@gmail.com> writes:
Show 19 quoted lines
> On 3/4/2014 12:29 AM, Junio C Hamano wrote:
> ...
>> then you
>> shouldn't be mucking with environment variables in the first place,
>> primarily because running:
>>
>>      $ GIT_TEST_ONLY='1 4' make test
>>
>> to run test .1 and .4 of all the test scripts would not make any
>> sense.
>
> No it does not.  It only makes sense for one test suite.
>
>> I think your "simplicity" argument is a total red-herring.
>> Of course if you do not have to say the test script name, your
>> specification would be shorter, but that is only because your
>> specification is not specific enough to be useful.
>
> In my case it is very useful :)

It invites a nonsense usage (i.e. running "make test" under that environment variable setting); that is not a good trade-off.

Show 15 quoted lines
>>   * Even though GIT_SKIP_TESTS mechanism still allows you to skip
>>     individual test pieces, it has never been a serious "feature" in
>>     the first place. Many of the tests unfortunately do rely on state
>>     previous sequences of tests left behind, so it is not realistic
>>     to expect that you can skip test pieces randomly and exercise
>>     later test pieces reliably.
>>
>>   * The numbering of individual test pieces can easily change by new
>>     tests inserted in the middle; again, many tests do take advantge
>>     of the states earlier tests leave behind, so "do not add new
>>     tests in the middle" is not a realistic rule to enforce, unless
>>     you are willing to clean up existing test scripts so that each
>>     test piece is independent from all the previous ones.
>
> Both are true, but do not apply to the TDD case.

The existing tests are designed to be black-box tests, not function level unit tests, and touching lower level code carelessly affects other parts of the system you did not know the interactions about.

What does "TDD case" change anything in that equation?
Previous: Ilya BobyrNext: Philip Oakley
Message 12 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.