Re: [RFC/PATCH (WIP)] gitweb: Use Test::WWW::Mechanize::CGI to test gitweb output
- From
- Lea Wiemann <lewiemann@gmail.com>
- Date
- Jun 14, 2008, 18:18 UTC
- Message-ID
- <48540B68.1050108@gmail.com>
- In-Reply-To
- <200806141447.28052.jnareb@gmail.com>
Jakub Narebski wrote:
> + skip "Could not get $pagename", 2 + $lint_installed
> + unless $mech->get_ok('http://localhost/', "GET $pagename");Just noticed this -- here's the cause of the problem I encountered in my previous post.
You can't really probe for a running gitweb installation on localhost, because even if there's one, you don't know if you're testing against your tree and your test repo.
So unless it's (easily) possible to force Mechanize to eat gitweb.cgi's output in lieu of making actual HTTP requests, I'd suggest that we simply use an environment variable (e.g. GITWEB_TEST_BASE_URL=http://localhost/cgi-bin/gitweb.cgi) -- if it's unset, the tests get skipped, otherwise they're run against that base URL.
*wanders-off-to-write-a-patch*
-- Lea