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

Re: [PATCH v2 1/3] t/gitweb-lib.sh: print to stderr when gitweb_run has errors

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 21, 2011, 06:40 UTC
Message-ID
<7vmxlplwjx.fsf@alter.siamese.dyndns.org>
In-Reply-To
<201102191916.21164.jnareb@gmail.com>
Jakub Narebski <jnareb@gmail.com> writes:
Show 7 quoted lines
> Because '--immediate' stops test suite after first error, therefore in
> this mode
>
>   test_debug 'cat gitweb.log'
>
> was never ran, thus in effect negating effect of '--debug' option.
> This made finidng the cause of errors in gitweb test sute difficult.

I think the patch itself makes sense, but I actually don't agree with the above reasoning.

The point of --immediate is not just it stops where we find a failure, but also it leaves the trash directory intact, so that _you_ who started the test with --immediate can run the "cat gitweb.log" yourself.

In other words, I think test_debug is overused. In the current setting, I think a sane way to debug the test script itself would probably be

	sh -x tXXXX-xxxx.sh -i -v -d
so that:
 (1) with -x I can see what commands are being run;
 (2) with -i I can stop the test immediately upon the first failure;
 (3) with -v I can see the output from the commands that we usually do not
     show; and
 (4) with -d I can be sure that trash directory does not go away.

Notice that I do not count "I can see test_debug executed" as a benefit from (4) above?

My preference, although I do not care too deeply, would be to gradually remove test_debug calls that were casually sprinkled and left in the test scripts while they were initially developed, and have the regular test sequence run them just like your patch does. Another change I would welcome would be to make the "-d" option automatically trigger shell tracing, to make it unnecessary to say "sh -x".

Previous: Ævar Arnfjörð BjarmasonNext: Ævar Arnfjörð Bjarmason
Message 8 of 15 in “gitweb/gitweb.perl: remove use of qw(...) as parentheses”
  1. gitweb/gitweb.perl: remove use of qw(...) as parenthesesÆvar Arnfjörð Bjarmason, Feb 19, 2011
  2. 0/3 Fix failure-causing warnings in Gitweb + improve gitweb-lib.shÆvar Arnfjörð Bjarmason, Feb 19, 2011
  3. 1/3 t/gitweb-lib.sh: print to stderr when gitweb_run has errorsÆvar Arnfjörð Bjarmason, Feb 19, 2011
  4. Jakub NarebskiFeb 19, 2011
  5. Ævar Arnfjörð BjarmasonFeb 19, 2011
  6. Jakub NarebskiFeb 19, 2011
  7. Ævar Arnfjörð BjarmasonFeb 19, 2011
  8. Junio C HamanoFeb 21, 2011
  9. 2/3 gitweb/gitweb.perl: remove use of qw(...) as parenthesesÆvar Arnfjörð Bjarmason, Feb 19, 2011
  10. Jakub NarebskiFeb 19, 2011
  11. Jakub NarebskiFeb 19, 2011
  12. Ævar Arnfjörð BjarmasonFeb 19, 2011
  13. Jakub NarebskiFeb 20, 2011
  14. 3/3 gitweb/gitweb.perl: don't call S_ISREG() with undefÆvar Arnfjörð Bjarmason, Feb 19, 2011
  15. Jakub NarebskiFeb 19, 2011

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.