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

Re: [RFC PATCH] tests: fix PATH for GIT_TEST_INSTALLED tests

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Apr 14, 2018, 12:30 UTC
Message-ID
<nycvar.QRO.7.76.6.1804141423530.234@ZVAVAG-6OXH6DA.rhebcr.pbec.zvpebfbsg.pbz>
In-Reply-To
<20180414003338.27091-1-layus.on@gail.com>
Hi Guillaume,
On Sat, 14 Apr 2018, Guillaume Maudoux wrote:
Show 36 quoted lines
> From: Guillaume Maudoux <layus.on@gmail.com>
> 
> When running tests on an existing git installation with
> GIT_TEST_INSTALLED (as described in t/README), the test helpers are
> missing in the PATH.
> 
> This fixes the test suite in a way that allows all the tests to pass.
> 
> Signed-off-by: Guillaume Maudoux <layus.on@gmail.com>
> ---
> 
> This is more a bug report than a real patch. The issue is described
> above and this patch does solve it. I however think that someone with
> more knowledge should refactor all that chunck of code that was last
> changed in 2010.
> 
> In particular, it seems that the GIT_TEST_INSTALLED path does not use
> bin-wrappers at all. This may imply that --with-dashes also breaks
> tests.
> 
>  t/test-lib.sh | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git t/test-lib.sh t/test-lib.sh
> index 7740d511d..0d51261f7 100644
> --- t/test-lib.sh
> +++ t/test-lib.sh
> @@ -923,7 +923,7 @@ elif test -n "$GIT_TEST_INSTALLED"
>  then
>  	GIT_EXEC_PATH=$($GIT_TEST_INSTALLED/git --exec-path)  ||
>  	error "Cannot run git from $GIT_TEST_INSTALLED."
> -	PATH=$GIT_TEST_INSTALLED:$GIT_BUILD_DIR:$PATH
> +	PATH=$GIT_TEST_INSTALLED:$GIT_BUILD_DIR/t/helper:$GIT_BUILD_DIR:$PATH
>  	GIT_EXEC_PATH=${GIT_TEST_EXEC_PATH:-$GIT_EXEC_PATH}
>  else # normal case, use ../bin-wrappers only unless $with_dashes:
>  	git_bin_dir="$GIT_BUILD_DIR/bin-wrappers"
This is essentially identical to what we have in
http://github.com/git-for-windows/git/commit/e408b7517d
So: ACK.

You might also want to go a bit further and let the test suite run with GIT_TEST_INSTALLED when Git has not actually be built, but only the test helpers. I started something along those lines here:

http://github.com/git-for-windows/git/commit/a80f047abc5

I always meant to come back to polish those patches and submit them to the Git mailing list, so: thank you for getting the ball rolling.

FWIW my use case is that I want to test a "MinGit" package, i.e. a subset of Git for Windows intended to cater to third-party applications requiring Git functionality (but not requiring any interactive parts of it).

What is your use case?

Ciao, Johannes

Previous: Guillaume MaudouxNext: Guillaume Maudoux (Layus)
Message 2 of 3 in “tests: fix PATH for GIT_TEST_INSTALLED tests”
  1. tests: fix PATH for GIT_TEST_INSTALLED testsGuillaume Maudoux, Apr 14, 2018
  2. Johannes SchindelinApr 14, 2018
  3. Guillaume Maudoux (Layus)Apr 14, 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.