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

Re: Test failures with python versions when building git 1.8.1

From
Junio C Hamano <gitster@pobox.com>
Date
Jan 2, 2013, 16:34 UTC
Message-ID
<7vip7f4k7x.fsf@alter.siamese.dyndns.org>
In-Reply-To
<20130102085935.GB9328@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
> Whether we end up doing something with contrib and tests or not, the
> patch below gives a minimal fix in the meantime.

Replacing the symbolic link with write_script that uses exported variables looks like a familiar pattern. I like it.

Oh, wait. That pattern is of course familiar, because 5a02966 (t9020: use configured Python to run the test helper, 2012-12-18) has been in 'next', and is planned for the first batch.

Show 50 quoted lines
> -- >8 --
> Subject: [PATCH] t9020: don't run python from $PATH
>
> In t9020, we symlink in a python script from contrib to help
> with the testing. However, we don't munge its #!-line, which
> means we may run the wrong python (we want the one in
> PYTHON_PATH). On top of this, we use a symlink without
> checking the SYMLINKS prereq, and we fail to properly quote
> GIT_BUILD_DIR, which may have spaces.
>
> Instead of symlinking, let's just write a small script which
> will feed the contrib script to PYTHON_PATH. To avoid
> quoting issues, we just export the variables the script
> needs to run.
>
> Signed-off-by: Jeff King <peff@peff.net>
> ---
>  t/t9020-remote-svn.sh | 5 ++++-
>  t/test-lib.sh         | 2 +-
>  2 files changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/t/t9020-remote-svn.sh b/t/t9020-remote-svn.sh
> index 4f2dfe0..416623b 100755
> --- a/t/t9020-remote-svn.sh
> +++ b/t/t9020-remote-svn.sh
> @@ -14,7 +14,10 @@ export PATH="$HOME:$PATH"
>  
>  # We override svnrdump by placing a symlink to the svnrdump-emulator in .
>  export PATH="$HOME:$PATH"
> -ln -sf $GIT_BUILD_DIR/contrib/svn-fe/svnrdump_sim.py "$HOME/svnrdump"
> +export GIT_BUILD_DIR
> +write_script svnrdump <<\EOF
> +exec "$PYTHON_PATH" "$GIT_BUILD_DIR"/contrib/svn-fe/svnrdump_sim.py "$@"
> +EOF
>  
>  init_git () {
>  	rm -fr .git &&
> diff --git a/t/test-lib.sh b/t/test-lib.sh
> index f50f834..c17db19 100644
> --- a/t/test-lib.sh
> +++ b/t/test-lib.sh
> @@ -45,7 +45,7 @@ fi
>  fi
>  
>  . "$GIT_BUILD_DIR"/GIT-BUILD-OPTIONS
> -export PERL_PATH SHELL_PATH
> +export PERL_PATH SHELL_PATH PYTHON_PATH
>  
>  # if --tee was passed, write the output not only to the terminal, but
>  # additionally to the file test-results/$BASENAME.out, too.
Previous: Dan McGeeNext: Jeff King
Message 11 of 12 in “Test failures with python versions when building git 1.8.1”
  1. Dan McGeeJan 2, 2013
  2. Junio C HamanoJan 2, 2013
  3. Eric S. RaymondJan 2, 2013
  4. Jeff KingJan 2, 2013
  5. Junio C HamanoJan 2, 2013
  6. Jeff KingJan 2, 2013
  7. Joachim SchmitzJan 2, 2013
  8. Dan McGeeJan 2, 2013
  9. Junio C HamanoJan 2, 2013
  10. Dan McGeeJan 2, 2013
  11. Junio C HamanoJan 2, 2013
  12. Jeff KingJan 2, 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.