You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Thomas Lochmatter <li...@lothosoft.ch> on 2005/02/15 11:24:56 UTC
Apache::Test for online debugging
Under mod_perl 1, I used the following simple debugging
framework:
1. apache calls DebugClient
2. DebugClient connects to DebugServer (Unix socket)
3. DebugServer calls the request handler with a fake
Apache object (Apache::FakeRequest) and returns the
response to the DebugClient
If an error occured, the DebugClient displayed the error
instead of the response. When a source file changed, the
DebugServer did the necessary preprocessing of the file and
restarted itself.
This way, I could easily debug my request handler. When I
modified a file and rerun the request, I either saw the new
response or a nicely displayed error message. I did not
have to restart the apache webserver or look for the error
in the log files.
Does a similar framework exist in mod_perl 2?
I have heard about Apache::Test. Is this a solution?
Regards,
Thomas
Re: Apache::Test for online debugging
Posted by Stas Bekman <st...@stason.org>.
Geoffrey Young wrote:
[...]
>>Also, a few weeks ago Stas mentioned an Apache::Test mailing list,
>>test-dev@httpd.apache.org. I joined that list and tried to post a
>>question, but it didn't post. Anyone know if that list is working?
>
>
> it's test-dev@perl.apache.org and should be ok.
That's because this list have moved a few days ago. The updated info is here:
http://perl.apache.org/maillist/test-dev.html
http://perl.apache.org/maillist/test-commits.html
--
__________________________________________________________________
Stas Bekman JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org http://ticketmaster.com
Re: Apache::Test for online debugging
Posted by Geoffrey Young <ge...@modperlcookbook.org>.
> I'm transitioning to developing using Apache::Test and like it. It's a
> different style of developing.
>
> Have you looked at the apache test docs?
>
> http://perl.apache.org/docs/general/testing/testing.html
see also
http://www.perl.com/pub/a/2003/05/22/testing.html
for a kinder, gentler introduction that leaves many of the more gory (but
cool and important) details out :)
>
> Stealing tests from other projects is often suggested. The mod perl 2
> test suite is a good place to look.
yes, as is the t/ directory of the perl-framework:
http://svn.apache.org/viewcvs.cgi/httpd/test/trunk/perl-framework/t/
I have yet to find some aspect of apache that I needed to test that wasn't
in there.
> Can anyone suggest any other Apache modules that might have a rich testing
> suite from which to steal testing ideas?
most of my more recent apache-based modules on cpan use Apache-Test
http://search.cpan.org/~geoff/
Apache-SSLLookup is kinda interesting as it combines both client and
server-side tests (or unit tests and function tests if you want to look at
it that way) - it unit tests the API from the server side but includes
client-side function tests to make sure that the API, when implemented, does
what it is supposed to.
Apache-Clean and Apache-IncludeHook have some interesting uses of
t_write_perl_script() and t_write_file() that might be helpful as well.
you can also check out the code from a tutorial I gave at ApacheCon 2004
http://www.modperlcookbook.org/~geoff/slides/ApacheCon/2004/test-driven-development-code.tar.gz
I know Jim was present for the tutorial, but just in case others weren't,
there is some interesting stuff in there if you want to use Apache-Test to
test Apache C extension modules. there is also
http://www.modperlcookbook.org/~geoff/slides/ApacheCon/2004/testing-php-with-perl-code.tar.gz
for those perl folks who are forced to use php ;)
>
> Also, a few weeks ago Stas mentioned an Apache::Test mailing list,
> test-dev@httpd.apache.org. I joined that list and tried to post a
> question, but it didn't post. Anyone know if that list is working?
it's test-dev@perl.apache.org and should be ok.
--Geoff
Re: Apache::Test for online debugging
Posted by Jim Martinez <jj...@bigbigorg.org>.
On Feb 15 Thomas Lochmatter wrote:
> Under mod_perl 1, I used the following simple debugging
> framework:
> 1. apache calls DebugClient
> 2. DebugClient connects to DebugServer (Unix socket)
> 3. DebugServer calls the request handler with a fake
> Apache object (Apache::FakeRequest) and returns the
> response to the DebugClient
>
> If an error occured, the DebugClient displayed the error instead of the
> response. When a source file changed, the DebugServer did the necessary
> preprocessing of the file and restarted itself.
>
> This way, I could easily debug my request handler. When I modified a
> file and rerun the request, I either saw the new response or a nicely
> displayed error message. I did not have to restart the apache webserver
> or look for the error in the log files.
>
> Does a similar framework exist in mod_perl 2? I have heard about
> Apache::Test. Is this a solution?
>
> Regards,
> Thomas
>
I'm transitioning to developing using Apache::Test and like it. It's a
different style of developing.
Have you looked at the apache test docs?
http://perl.apache.org/docs/general/testing/testing.html
Stealing tests from other projects is often suggested. The mod perl 2
test suite is a good place to look.
Can anyone suggest any other Apache modules that might have a rich testing
suite from which to steal testing ideas?
Also, a few weeks ago Stas mentioned an Apache::Test mailing list,
test-dev@httpd.apache.org. I joined that list and tried to post a
question, but it didn't post. Anyone know if that list is working?
I received automated requests and confirmation emails so I think I'm on
the test-dev list.
Regards,
Jim