Adam Kennedy wrote:
> I'd also add a small warning in that Apache::Test does seem to want to
> dominate the entire test suite (run everything from TEST) and so may not
> be as suitable in cases where you have 50-500 test scripts already, and
> you just want a few to work with Apache::Test and a normal Makefile.PL
> built with something like Module::Install.
> 
> So I've had to limit my use of it to specific cases where mod_perl
> dominates the purpose of the entire distribution.
> 
> Unless you've fixed this since the tutorial :)
> 
> Because I really don't mind the cost of having to boot up TEST 4 times
> for 4 scripts, when only 4 out of 100 need it.

well, there's no harm in using Apache-Test to run _everything_, even if only
4 out of 100 test scripts need the apache server - it's not like t/TEST adds
any real overhead to the process, since _something_ needs to call runtests...

but if you are talking about "test-code-test-code-test" overhead, where A-T
starts and stops the server each time even if you don't need it and you're a
developer who only wants to run a single script, then yeah, I hear ya :)

in truth, that was the biggest complaint about A-T from the developers here
at work - when you don't need apache and only want to run a single test over
and over again it just takes too long.  so, a few things were added to
Apache-Test to try to remedy this...

the first is that you can pass -no-httpd to Apache-Test, like so

  $ export APACHE_TEST_EXTRA_ARGS=-no-httpd
  $ make test TEST_FILES=t/noapache.t
  [ no server configuration or startup ]

which saves a boatload of time.  you can actually speed things up even more
by using the 'make run_tests' target instead of 'make test' - the test
target runs a full clean scan to hook the autogenerated A-T magic each time,
which you obviously don't need if you're not interested in A-T.

so, use both of those techniques and you'll find the overhead gets very low.

I'll warn you, though, you're going to get bitten by -no-httpd and/or
run_tests eventually.  some day, you're going to try to run the apache-based
tests and you'll have -no-httpd in your environment and things will blow up
and you'll spend half a day trying to figure out why.  or you'll add a new
A-T test file and use run_tests and the test won't work and you will scratch
your head.  so you'll curse A-T and it's magic for a while...

anyway, HTH.  and I wish there were more time in life that I could
communicate all this greatness to the masses in some talk or docs, but there
just isn't (for me, anyway...)

--Geoff

Reply via email to