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

Re: [PATCH] tests: send "bug in the test script" errors to the script's stderr

From
Jeff King <peff@peff.net>
Date
Nov 20, 2018, 10:45 UTC
Message-ID
<20181120104528.GA26263@sigill.intra.peff.net>
In-Reply-To
<20181119233404.GW30222@szeder.dev>
On Tue, Nov 20, 2018 at 12:34:04AM +0100, SZEDER Gábor wrote:
Show 9 quoted lines
> > I do notice that many of the existing "FATAL:" errors use descriptor 5,
> > which goes to stdout. I'm not sure if those should actually be going to
> > stderr (or if there's some TAP significance to those lines).
> 
> I chose to send these messages to standard error, because they are,
> well, errors.  TAP only cares about stdout, but by aborting the test
> script in BUG(), error() or die() we are already violating TAP anyway,
> so I don't think it matters whether we send "bug in test script" or
> "FATAL" errors to stdout or stderr.

Yeah, I agree it probably doesn't matter. I was mostly suggesting to make the existing ">&5" into ">&7" for consistency. But I don't think that needs to block your patch.

> BTW, TAP understands "Bail out!" as bail out from the _entire_ test
> suite, but that's not what we want here, I'd think.
> 
> https://testanything.org/tap-specification.html#bail-out
Yes, I added the only existing "Bail out!" to test-lib.sh. :)

I agree that's not what we want here. I actually think the current behavior (to exit non-zero) does what we want. A TAP harness will realize that's an error, but not block other scripts.

-Peff
Previous: SZEDER GáborNext: Jeff King
Message 4 of 6 in “tests: send "bug in the test script" errors to the script's stderr”
  1. tests: send "bug in the test script" errors to the script's stderrSZEDER Gábor, Nov 19, 2018
  2. Jeff KingNov 19, 2018
  3. SZEDER GáborNov 19, 2018
  4. Jeff KingNov 20, 2018
  5. Jeff KingNov 20, 2018
  6. SZEDER GáborNov 20, 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.