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

Re: [PATCH 1/2] remote-helpers: tests: use python directly

From
Junio C Hamano <gitster@pobox.com>
Date
May 18, 2013, 02:12 UTC
Message-ID
<7vwqqxujby.fsf@alter.siamese.dyndns.org>
In-Reply-To
<1368825008-2815-2-git-send-email-felipe.contreras@gmail.com>
Felipe Contreras <felipe.contreras@gmail.com> writes:
Show 5 quoted lines
> These remote helpers use 'env python', not PYTHON_PATH, so that's where
> we should check for the extensions. Otherwise, if 'python' is not
> PYTHON_PATH (e.g. /usr/bin/python: Makefile's default), there will be a
> mismatch between the python libraries actually accessible to the remote
> helpers.

What I am reading here is that what the "helper" uses and what the "test" checks to see if it can use the "helper" were different; and this patch fixes that misalignment by testing what the "helper" actually uses.

So it is a right thing to do in that sense.

I however am having this nagging feeling that I may be missing something subtle here. Comments from others are very much welcome.

Will queue but the result will be on tomorrow's pushout.
Thanks.
Show 67 quoted lines
> Suggested by: Torsten Bögershausen <tboegi@web.de>
> Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
> ---
>  contrib/remote-helpers/test-bzr.sh       | 2 +-
>  contrib/remote-helpers/test-hg-bidi.sh   | 2 +-
>  contrib/remote-helpers/test-hg-hg-git.sh | 4 ++--
>  contrib/remote-helpers/test-hg.sh        | 2 +-
>  4 files changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/contrib/remote-helpers/test-bzr.sh b/contrib/remote-helpers/test-bzr.sh
> index 5dfa070..2c89caa 100755
> --- a/contrib/remote-helpers/test-bzr.sh
> +++ b/contrib/remote-helpers/test-bzr.sh
> @@ -12,7 +12,7 @@ if ! test_have_prereq PYTHON; then
>  	test_done
>  fi
>  
> -if ! "$PYTHON_PATH" -c 'import bzrlib'; then
> +if ! python -c 'import bzrlib'; then
>  	skip_all='skipping remote-bzr tests; bzr not available'
>  	test_done
>  fi
> diff --git a/contrib/remote-helpers/test-hg-bidi.sh b/contrib/remote-helpers/test-hg-bidi.sh
> index f569697..2c693d0 100755
> --- a/contrib/remote-helpers/test-hg-bidi.sh
> +++ b/contrib/remote-helpers/test-hg-bidi.sh
> @@ -15,7 +15,7 @@ if ! test_have_prereq PYTHON; then
>  	test_done
>  fi
>  
> -if ! "$PYTHON_PATH" -c 'import mercurial'; then
> +if ! python -c 'import mercurial'; then
>  	skip_all='skipping remote-hg tests; mercurial not available'
>  	test_done
>  fi
> diff --git a/contrib/remote-helpers/test-hg-hg-git.sh b/contrib/remote-helpers/test-hg-hg-git.sh
> index 8440341..fbad2b9 100755
> --- a/contrib/remote-helpers/test-hg-hg-git.sh
> +++ b/contrib/remote-helpers/test-hg-hg-git.sh
> @@ -15,12 +15,12 @@ if ! test_have_prereq PYTHON; then
>  	test_done
>  fi
>  
> -if ! "$PYTHON_PATH" -c 'import mercurial'; then
> +if ! python -c 'import mercurial'; then
>  	skip_all='skipping remote-hg tests; mercurial not available'
>  	test_done
>  fi
>  
> -if ! "$PYTHON_PATH" -c 'import hggit'; then
> +if ! python -c 'import hggit'; then
>  	skip_all='skipping remote-hg tests; hg-git not available'
>  	test_done
>  fi
> diff --git a/contrib/remote-helpers/test-hg.sh b/contrib/remote-helpers/test-hg.sh
> index 8de2aa7..ce03fa3 100755
> --- a/contrib/remote-helpers/test-hg.sh
> +++ b/contrib/remote-helpers/test-hg.sh
> @@ -15,7 +15,7 @@ if ! test_have_prereq PYTHON; then
>  	test_done
>  fi
>  
> -if ! "$PYTHON_PATH" -c 'import mercurial'; then
> +if ! python -c 'import mercurial'; then
>  	skip_all='skipping remote-hg tests; mercurial not available'
>  	test_done
>  fi
Previous: Felipe ContrerasNext: David Aguilar
Message 3 of 12 in “remote-helpers: test fixes”
  1. 0/2 remote-helpers: test fixesFelipe Contreras, May 17, 2013
  2. 1/2 remote-helpers: tests: use python directlyFelipe Contreras, May 17, 2013
  3. Junio C HamanoMay 18, 2013
  4. David AguilarMay 18, 2013
  5. Felipe ContrerasMay 18, 2013
  6. Junio C HamanoMay 19, 2013
  7. Felipe ContrerasMay 19, 2013
  8. 2/2 remote-hg: tests: fix hg mergeFelipe Contreras, May 17, 2013
  9. Junio C HamanoMay 20, 2013
  10. Felipe ContrerasMay 20, 2013
  11. Junio C HamanoMay 20, 2013
  12. Felipe ContrerasMay 20, 2013

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.