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

Re: [PATCH] tests: introduce test_unset_prereq, for debugging

From
Junio C Hamano <gitster@pobox.com>
Date
May 7, 2018, 14:22 UTC
Message-ID
<xmqqfu33pmtv.fsf@gitster-ct.c.googlers.com>
In-Reply-To
<20180507115950.3887-1-szeder.dev@gmail.com>
SZEDER Gábor <szeder.dev@gmail.com> writes:
Show 15 quoted lines
>> For convenience, the following two methods are now supported ways to
>> pretend that a prereq is not met:
>> 
>> 	test_set_prereq !GPG
>> 
>> and
>> 
>> 	test_unset_prereq GPG
>
> I'm not sure this is the right way to do this.
>
> I wanted to run the whole test suite with all GPG tests skipped the
> other day.  With this 'test_unset_prereq' I would have to modify all
> test scripts containing tests depending on the GPG prereq and add
> 'test_unset_prereq GPG', right?
Excellent point.  This won't cover that use case well.

That does not mean this change is useless. If you are focusing on developing a single test script, you can afford to tentatively add these set/unset, just like you tentatively debug with echo's ;-)

But I find your SKIP_PREREQS an excellent idea.

It may want to be FORCE_PREREQS that lets you pretend a prereq is not satisfied on your machine even when it actually is, and also lets you pretend a prereq is satisfied on your machine even when it is not. SKIP_PREREQS would only do the first half, which would be sufficient most of the time, though.

> I think we would be better served by an environment variable similar
> to $GIT_SKIP_TESTS, e.g. $GIT_SKIP_PREREQS, to list all the prereqs
> that should be skipped even if they were met.
Previous: SZEDER Gábor
Message 4 of 4 in “tests: introduce test_unset_prereq, for debugging”
  1. tests: introduce test_unset_prereq, for debuggingJohannes Schindelin, Apr 28, 2018
  2. Junio C HamanoApr 30, 2018
  3. SZEDER GáborMay 7, 2018
  4. Junio C HamanoMay 7, 2018

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.