[Catalyst] writing a test suite for my app
Perrin Harkins
perrin at elem.com
Fri May 19 18:11:37 CEST 2006
On Fri, 2006-05-19 at 16:50 +0100, Matt S Trout wrote:
> I'm afraid you're dead wrong there. TWMC uses Catalyst::Test, which as clearly
> documented, simulates by *default* but if a CATALYST_SERVER environment
> variable is present goes and does a full live test using the copy of the
> application running at the URL in that environment variable.
Okay, but the T::W::M::Catalyst docs clearly say that it doesn't hit the
server, so I guess they need an update.
> Except that that's a complete pain for local tests, since it's difficult to
> find a URL you can rely on for the application without knowing your local
> network configuration
I do know my local network configuration :)
> this can be seen clearly by the fact that
> Test::WWW::Mechanize has to be force installed on every development server we
> have since its won tests rely on http://localhost/ without checking to see if
> $ENV{http_proxy} is set.
Test in CPAN modules meant to be run by end users on all different OSes
and networks are kind of a different beast from tests on your
organization's own application. When testing your in-house development,
you can make certain assumptions, and have your tests start up a server
or check to see if one is running.
I've had several problems caused by web server configuration issues when
I skipped going through the server in my tests, especially since I often
use separate server modules for things like auth and compression. I
just don't trust simulating the web server environment anymore.
- Perrin
More information about the Catalyst
mailing list