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

[PATCH 1/8 v1] gitweb: Make running t9501 test with '--debug' reliable and usable

From
Jakub Narebski <jnareb@gmail.com>
Date
Jan 30, 2010, 22:30 UTC
Message-ID
<1264890645-28310-2-git-send-email-jnareb@gmail.com>
In-Reply-To
<1264890645-28310-1-git-send-email-jnareb@gmail.com>

Remove test_debug lines after 'snapshots: tgz only default format enabled' and 'snapshots: all enabled in default, use default disabled value' tests. Those tests constitute of multiple gitweb_run invocation, therefore outputting gitweb.output for the last gitweb_run wouldn't help much in debugging test failure, and can only confuse.

For snapshot tests which check for "200 OK" status, change
  test_debug 'cat gitweb.output'
to
  test_debug 'cat gitweb.headers'
Otherwise when running this test with '--debug' option,
t/t9501-gitweb-standalone-http-status.sh would dump *binary data* (the
snapshot itself) to standard output, which can mess up state of terminal
due to term control characters which can be embedded in output.
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
---
This patch appears in this series for the first time.

I have decided against cleaning up t/t9501-gitweb-standalone-http-status.sh by conforming to single style of quoting and whitespaces, and by putting initial test_commit inside test_expect_success setup. This is the minimal change.

 t/t9501-gitweb-standalone-http-status.sh |    8 +++-----
 1 files changed, 3 insertions(+), 5 deletions(-)
diff --git a/t/t9501-gitweb-standalone-http-status.sh b/t/t9501-gitweb-standalone-http-status.sh
index 0688a57..9e8bc01 100755
--- a/t/t9501-gitweb-standalone-http-status.sh
+++ b/t/t9501-gitweb-standalone-http-status.sh
@@ -33,7 +33,6 @@ test_expect_success \
     grep "403 - Snapshot format not allowed" gitweb.output &&
     gitweb_run "p=.git;a=snapshot;h=HEAD;sf=zip" &&
     grep "403 - Unsupported snapshot format" gitweb.output'
-test_debug 'cat gitweb.output'
 
 
 cat >>gitweb_config.perl <<\EOF
@@ -50,7 +49,6 @@ test_expect_success \
     grep "403 - Snapshot format not allowed" gitweb.output &&
     gitweb_run "p=.git;a=snapshot;h=HEAD;sf=zip" &&
     grep "Status: 200 OK" gitweb.output'
-test_debug 'cat gitweb.output'
 
 
 cat >>gitweb_config.perl <<\EOF
@@ -72,7 +70,7 @@ test_expect_success \
     'snapshots: tgz explicitly enabled' \
     'gitweb_run "p=.git;a=snapshot;h=HEAD;sf=tgz" &&
     grep "Status: 200 OK" gitweb.output'
-test_debug 'cat gitweb.output'
+test_debug 'cat gitweb.headers'
 
 
 # ----------------------------------------------------------------------
@@ -82,7 +80,7 @@ test_expect_success 'snapshots: good tree-ish id' '
 	gitweb_run "p=.git;a=snapshot;h=master;sf=tgz" &&
 	grep "Status: 200 OK" gitweb.output
 '
-test_debug 'cat gitweb.output'
+test_debug 'cat gitweb.headers'
 
 test_expect_success 'snapshots: bad tree-ish id' '
 	gitweb_run "p=.git;a=snapshot;h=frizzumFrazzum;sf=tgz" &&
@@ -105,7 +103,7 @@ test_expect_success 'snapshots: good object id' '
 	gitweb_run "p=.git;a=snapshot;h=$ID;sf=tgz" &&
 	grep "Status: 200 OK" gitweb.output
 '
-test_debug 'cat gitweb.output'
+test_debug 'cat gitweb.headers'
 
 test_expect_success 'snapshots: bad object id' '
 	gitweb_run "p=.git;a=snapshot;h=abcdef01234;sf=tgz" &&
-- 
1.6.6.1
Previous: Jakub NarebskiNext: Jakub Narebski
Message 2 of 14 in “Miscelanous gitweb improvements from 'Gitweb caching v5' by J.H.”
  1. 0/8 Miscelanous gitweb improvements from 'Gitweb caching v5' by J.H.Jakub Narebski, Jan 30, 2010
  2. 1/8 gitweb: Make running t9501 test with '--debug' reliable and usableJakub Narebski, Jan 30, 2010
  3. 2/8 gitweb: Load checkingJakub Narebski, Jan 30, 2010
  4. 3/8 gitweb: Makefile improvementsJakub Narebski, Jan 30, 2010
  5. 4/8 gitweb: Check that $site_header etc. are defined before using themJakub Narebski, Jan 30, 2010
  6. 5/8 gitweb: add a get function to compliment print_local_timeJakub Narebski, Jan 30, 2010
  7. Junio C HamanoJan 31, 2010
  8. 6/8 gitweb: add a get function to compliment print_sort_thJakub Narebski, Jan 30, 2010
  9. 7/8 gitweb: Add optional extra parameter to die_error, for extended explanationJakub Narebski, Jan 30, 2010
  10. 8/8 gitweb: Add an option to force version matchJakub Narebski, Jan 30, 2010
  11. J.H.Feb 2, 2010
  12. Jakub NarebskiFeb 2, 2010
  13. Junio C HamanoFeb 2, 2010
  14. Junio C HamanoFeb 2, 2010

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.