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

Re: [RFC/PATCH] tests: add initial bash completion tests

From
Felipe Contreras <felipe.contreras@gmail.com>
Date
Apr 6, 2012, 23:30 UTC
Message-ID
<CAMP44s3CA9e06QoJ_-QWoEevfY==CgqZrUu1EKn3zeVDdAyvOA@mail.gmail.com>
In-Reply-To
<7vk41szdev.fsf@alter.siamese.dyndns.org>
On Sat, Apr 7, 2012 at 1:46 AM, Junio C Hamano <gitster@pobox.com> wrote:
Show 15 quoted lines
> Felipe Contreras <felipe.contreras@gmail.com> writes:
>
>> On Sat, Apr 7, 2012 at 12:34 AM, Jeff King <peff@peff.net> wrote:
>>
>>> But my point still stands that you cannot assume that you are running
>>> bash, and you need to either find bash, or gracefully exit the test
>>> script if it is not available. Anything else will cause "make test" to
>>> fail on some systems (and indeed, applying and running your test, it
>>> breaks "make test" on my debian box with dash as /bin/sh).
>>
>> So? 'make test' fails on my Arch Linux box which doesn't have
>> /usr/bin/python, which is presumably why there is NO_PYTHON.
>
> If you "git grep NO_PYTHON", you would notice that t/test-lib.sh does have
> a provision to set PYTHON prerequisite,

Yes, but you have to specify NO_PYTHON, otherwise it would just assume python is installed.

> so fixing it presumably is just
> the matter of marking appropriate tests with the prerequisite, no?
You would still have to specify NO_PYTHON.
> Which ones are broken for you?
In fact, I do have python, but the program name is python2, but if I do this:
 export PYTHON_PATH=/usr/bin/python2
The tests fail on remote-helpers.
> Complaining about it in a thread that does not
> directly related to that "on a box without python some tests are broken"
> issue is a very good way to leave it unfixed.

My point is that the argument "this is worst than nothing because tests would break on X systems" seems rather weak to me considering that tests are already broken on Y systems.

Show 10 quoted lines
>> Instead
>> of doing some nasty hacks such as 'bash <<\END_OF_BASH_SCRIPT', it
>> would be much easier to have a NO_BASH option. And in fact, when zsh
>> completion tests are available, NO_ZSH (probably on by default).
>
> "The box does not have bash" and "The builder does not wish to let the
> scripts run with bash" are two separate things.  SHELL_PATH is often set
> to /bin/dash even on a box that has /bin/bash because it is much faster to
> run scripted Porcelains with, but the end user of the resulting build may
> still want to use bash in her interactive session.

So? SHELL_PATH would not interfere with NO_BASH/NO_ZSH. But in any case, I've sent a patch that detects bash presence, similarly to Jeff's patch.

Cheers.
-- 
Felipe Contreras
Previous: Junio C HamanoNext: Jeff King
Message 12 of 18 in “tests: add initial bash completion tests”
  1. tests: add initial bash completion testsFelipe Contreras, Apr 6, 2012
  2. Jeff KingApr 6, 2012
  3. Junio C HamanoApr 6, 2012
  4. Felipe ContrerasApr 6, 2012
  5. Jeff KingApr 6, 2012
  6. Felipe ContrerasApr 6, 2012
  7. Junio C HamanoApr 6, 2012
  8. Felipe ContrerasApr 6, 2012
  9. Jeff KingApr 6, 2012
  10. Felipe ContrerasApr 6, 2012
  11. Junio C HamanoApr 6, 2012
  12. Felipe ContrerasApr 6, 2012
  13. Jeff KingApr 6, 2012
  14. Felipe ContrerasApr 6, 2012
  15. Junio C HamanoApr 6, 2012
  16. Junio C HamanoApr 6, 2012
  17. Felipe ContrerasApr 7, 2012
  18. Jeff KingApr 6, 2012

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.