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

Re: [PATCH] test-lib: avoid full path to store test results

From
Jeff King <peff@peff.net>
Date
Oct 30, 2012, 04:28 UTC
Message-ID
<20121030042850.GA23263@sigill.intra.peff.net>
In-Reply-To
<1351570377-894-1-git-send-email-felipe.contreras@gmail.com>
On Tue, Oct 30, 2012 at 05:12:57AM +0100, Felipe Contreras wrote:
> No reason to use the full path in case this is used externally.

I think it is not just "no reason to", but it is actively wrong to use a full path, as we do not take care to "mkdir -p" the intervening path components.

However, this never comes up in practice, because all of the test scripts assume you are running them from the test directory (i.e., they will fail otherwise because they will not find ./test-lib.sh).

Is this in support of putting remote-hg tests in contrib/? I had expected you to just put

  export TEST_DIRECTORY="$(pwd)/../../../t"
  . "$TEST_DIRECTORY/test-lib.sh"

into the test script in contrib/remote-hg/t. I guess you are doing something like:

  cd ../../../t && ../contrib/remote-hg/t/twhatever...

but the former seems much simpler to invoke (and if the goal is to get your test-results in the right place, setting TEST_OUTPUT_DIRECTORY is the best way to do that).

If this is part of the remote-hg series, I'd prefer to just see it as part of the re-roll. It's much easier to evaluate it in context.

Or are you really just doing:
  cd git/t
  $PWD/t0000-basic.sh

I guess there is nothing wrong with that, though there is no reason not to use "./" instead of $PWD.

-Peff
Previous: Felipe ContrerasNext: Felipe Contreras
Message 2 of 18 in “test-lib: avoid full path to store test results”
  1. test-lib: avoid full path to store test resultsFelipe Contreras, Oct 30, 2012
  2. Jeff KingOct 30, 2012
  3. Felipe ContrerasOct 30, 2012
  4. Jonathan NiederOct 30, 2012
  5. Felipe ContrerasOct 30, 2012
  6. Jonathan NiederOct 31, 2012
  7. Felipe ContrerasOct 31, 2012
  8. Jonathan NiederOct 31, 2012
  9. Felipe ContrerasOct 31, 2012
  10. Johannes SixtOct 31, 2012
  11. Felipe ContrerasOct 31, 2012
  12. Jeff KingNov 2, 2012
  13. Felipe ContrerasNov 2, 2012
  14. Jeff KingNov 2, 2012
  15. Elia PintoOct 30, 2012
  16. Jonathan NiederOct 30, 2012
  17. Elia PintoOct 30, 2012
  18. Stefano LattariniOct 31, 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.