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

Re: [RFC/PATCH] t3300-*.sh: Fix a TAP parse error

From
Junio C Hamano <gitster@pobox.com>
Date
Jul 24, 2012, 19:57 UTC
Message-ID
<7veho1exu6.fsf@alter.siamese.dyndns.org>
In-Reply-To
<500EEAAA.8030604@ramsay1.demon.co.uk>
Ramsay Jones <ramsay@ramsay1.demon.co.uk> writes:
Show 12 quoted lines
> The only problematic platforms I test on are "NTFS/bash" on cygwin and MinGW.
> Since commit 2b843732 ("Suppress some bash redirection error messages",
> 26-08-2008), I have not noticed any complaints regarding this problem.
> What have I missed?
>
> Assuming we are not talking about errors like ENOSPC, EROFS etc., then the
> only command which would issue a complaint to stderr would be the line
> following the above snippet, thus:
>
>     +cat 2>/dev/null >"$p1" "$p0"
>
> (note the stderr redirection).

As I am more worried about longer-term health of the codebase, what the part you moved outside test_expect_* with this patch happens to do _right now_ is of secondary importance, at least from my point of view. The next patch that updates this scirpt may want to run more involved commands that can fail in different ways.

Being able to rely on the protection test_expect_* gives us in the set-up phase of the test has been very valuable (in addition to making the result more readable) to us. Can we keep that property in some way while also keeping the ability to skip the remainder of the test script?

Observing that all well-written test scripts we have begin with this boilerplate line:

	test_expect_success setup '

I wouldn't mind introducing a new helper function test_setup that behaves like test_expect_success but is meant to be used in the first "set-up" phase of the tests in a test script. Perhaps we can give its failure a meaning different than failures in other normal tests (e.g. "even set-up fails, and the remainder of the test is N/A here, hence abort the whole thing"), and do not count "test_setup" as part of the test (i.e. do not increment $test_count and friends).

Previous: Ramsay JonesNext: Ramsay Jones
Message 6 of 13 in “t3300-*.sh: Fix a TAP parse error”
  1. t3300-*.sh: Fix a TAP parse errorRamsay Jones, Jul 21, 2012
  2. Jonathan NiederJul 21, 2012
  3. Ramsay JonesJul 24, 2012
  4. Jonathan NiederJul 24, 2012
  5. Ramsay JonesJul 25, 2012
  6. Junio C HamanoJul 24, 2012
  7. Ramsay JonesJul 25, 2012
  8. Jonathan NiederJul 25, 2012
  9. Junio C HamanoJul 25, 2012
  10. Ramsay JonesJul 28, 2012
  11. Ramsay JonesJul 28, 2012
  12. Junio C HamanoAug 16, 2012
  13. Ramsay JonesAug 19, 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.