Subject: Re: [RFC/PATCH (WIP)] gitweb: Use Test::WWW::Mechanize::CGI to test gitweb output

From: Lea Wiemann <[email-masked]>
Date: Sat, 14 Jun 2008 20:31:12 +0200

Jakub Narebski wrote:
> Lea Wiemann wrote:
>> I think that gitweb should not be writing stuff to stderr unless an
>> internal or serious error occurs
>
> There is no option to git-rev-list to not write any output to stderr

Okay, this one will go away with the new API I'm writing, which uses 
cat-file --batch-check instead of rev-list.  In the meantime (and in 
other cases) I guess diverting stderr in the test code is fine.  (I 
wouldn't want to ignore stderr in all cases, even where you're not 
expecting any output on stderr, since that might actually indicate an 
error.)

> [snip]  It should work.  test-lib.sh sets up $PATH to have 'git' binary
> (just compiled git binary) in it...

Since you're accessing http://localhost/ URLs, the web server's PATH is 
in effect, which doesn't get overridden by the tests.  But anyways, 
using an environment variable (see my other email) will move the 
responsibility for this to the developer running the tests.

> I have changed t/t9503-gitweb-Mechanize.sh... 
> 
> -our \$GIT = "git";
> +our \$GIT = "$safe_pwd/../../git";

For t9503 this'll go away if the GITWEB_TEST_BASE_URL thing is 
implemented.  For t9500 (which contains $GIT = "git" as well), it should 
  be fine as is since test-lib.sh sets PATH and thus gitweb picks up the 
right binary.

-- Lea