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

Re: [PATCH] lib-httpd.sh: print error.log on error

From
Jeff King <peff@peff.net>
Date
Jun 12, 2016, 12:59 UTC
Message-ID
<20160612125921.GA15289@sigill.intra.peff.net>
In-Reply-To
<20160612104154.31446-1-pclouds@gmail.com>
On Sun, Jun 12, 2016 at 05:41:54PM +0700, Nguyễn Thái Ngọc Duy wrote:
Show 20 quoted lines
> Failure to bring up httpd for testing is not considered an error, so the
> trash directory, which contains this error.log file, is removed and we
> don't know what made httpd fail to start. Improve the situation a bit.
> 
> Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
> ---
>  t/lib-httpd.sh | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/t/lib-httpd.sh b/t/lib-httpd.sh
> index f9f3e5f..5b8de38 100644
> --- a/t/lib-httpd.sh
> +++ b/t/lib-httpd.sh
> @@ -180,6 +180,7 @@ start_httpd() {
>  	if test $? -ne 0
>  	then
>  		trap 'die' EXIT
> +		cat "$HTTPD_ROOT_PATH"/error.log 2>/dev/null
>  		test_skip_or_die $GIT_TEST_HTTPD "web server setup failed"
>  	fi

I like the idea of giving more data on error, but I think this will break the TAP output and confuse anything parsing the output of the tests, like prove (I think arbitrary output should have "#" prepended).

Also (or alternatively), it should probably only happen when we are in verbose mode (it's not taken care of for us as usual because tests call start_httpd outside of a test_expect_ block). I think this eliminates the need to deal with the TAP thing (because our usual "-v" output is not TAP-compliant).

-Peff
Previous: Nguyễn Thái Ngọc DuyNext: Duy Nguyen
Message 2 of 6 in “lib-httpd.sh: print error.log on error”
  1. lib-httpd.sh: print error.log on errorNguyễn Thái Ngọc Duy, Jun 12, 2016
  2. Jeff KingJun 12, 2016
  3. Duy NguyenJun 13, 2016
  4. Jeff KingJun 13, 2016
  5. lib-httpd.sh: print error.log on errorNguyễn Thái Ngọc Duy, Jun 13, 2016
  6. Jeff KingJun 13, 2016

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.