Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Devel::Cover under Apache::Test

by wazzuteke (Hermit)
on Oct 22, 2008 at 18:49 UTC ( [id://718830]=perlquestion: print w/replies, xml ) Need Help??

wazzuteke has asked for the wisdom of the Perl Monks concerning the following question:

Alright, monks - I'm at a total loss and can't seem to find anyone who's seen this issue before and was hoping you all could help ...

I am trying to get a mod_perl2 app (I will detail the specifics here in a bit) running Devel::Cover while being tested with Apache::Test. From everything I've read from Devel::Cover's POD to different forums (one of many examples including the mod_perl mailing lists) it's supported and been done before, yet I keep running into wall after wall. Here's where I've gotten:

  • I have Apache::Test working against my application, alone, with no problems
  • I have Devel::Cover, alone, working with no problems; proper output and everything I would expect.
  • Adding PerlSwitches -MDevel::Cover to my conf/extra_conf.in almost seems to work, but I get the following output:
[warning] setting ulimit to allow core files ulimit -c unlimited; /usr/bin/perl /home/trevor/Downloads/t/TEST -bugr +eport -verbose=0 /usr/local/apache2/trevor/bin/httpd -d /home/trevor/Downloads/t -f /h +ome/trevor/Downloads/t/conf/httpd.conf -D APACHE2 -D PERL_USEITHREADS using Apache/2.2.9 (prefork MPM) waiting 60 seconds for server to start: ..Devel::Cover 0.64: Collectin +g coverage data for branch, condition, statement, subroutine and time +. Pod coverage is unavailable. Please install Pod::Coverage from CP +AN. Collecting under mod_perl/2.0.3 Selecting packages matching: Ignoring packages matching: /Devel/Cover[./] Ignoring packages in: . /etc/perl /usr/lib/perl/5.8.8 /usr/lib/perl5 /usr/local/lib/perl/5.8.8 /usr/local/share/perl/5.8.8 /usr/share/perl/5.8.8 /usr/share/perl5 .[ error] server has died with status 255 (please examine t/logs/error_log) sh: line 1: 23494 Terminated /usr/bin/perl /home/trevor/D +ownloads/t/TEST -bugreport -verbose=0


With the following in my error logs:

Undefined subroutine &main:: called. END failed--call queue aborted.


Now, when compared to a normal Devel::Cover output on the same server, I get:

Devel::Cover 0.64: Collecting coverage data for branch, condition, sta +tement, subroutine and time. Pod coverage is unavailable. Please install Pod::Coverage from CP +AN. Selecting packages matching: Ignoring packages matching: /Devel/Cover[./] Ignoring packages in: . /etc/perl /usr/lib/perl/5.8.8 /usr/lib/perl5 /usr/local/lib/perl/5.8.8 /usr/local/share/perl/5.8.8 /usr/share/perl/5.8.8 /usr/share/perl5 ok 1 1..1 Devel::Cover: Writing coverage database to /home/trevor/Downloads/t/co +ver_db/runs/1224700621.23673.54862


With that, and without stepping through every tedious line of code of mine, Test, Apache and Devel, I can only assume Devel::Cover is dying when trying to attach to the unit test with Aapche::Test embedded within it... but I don't know.

Has anyone ever ran into this before and/or have any ideas/hints/hacks for a solution?

System Stats
  • Perl 5.8.8 standard Debian install
  • Apache::Test v1.29, packaged with mod_perl 2.0.3
  • Devel::Cover v0.64
  • Debian v4.0
  • ... I'm not sure what else you need, but feel free to ask

---------
perl -le '$.=[qw(104 97 124 124 116 97)];*p=sub{[@{$_[0]},(45)x 2]};*d=sub{[(45)x 2,@{$_[0]}]};print map{chr}@{p(d($.))}'

Replies are listed 'Best First'.
Re: Devel::Cover under Apache::Test
by wazzuteke (Hermit) on Oct 22, 2008 at 22:29 UTC
    Probably should have simply updated my original post, but ah well ...

    Given the massive flocking of monks to help me with this, along with the particularly awesome Google results it seems as though either I'm the only idiot trying to combine mod_perl2, Apache::Test and Devel::Cover or nobody knows how to fix it. In either event, I believe I have resolved the issue and figured I may as well update the post ...

    Effectively, in a Perl tag of my httpd.conf, I was loading DBI and Apache::DBI (along with countless other custom and CPAN modules). After getting a bare-bones unit test working, I started to strip elements from my httpd.conf and found that all DBI related classes, when loaded in httpd.conf (either via use in a Perl tag, PerlModule or PerlLoadModule mod_perl directives, I would get this hauntingly criptic error. I now use those modules outside of my httpd.conf and all works well. Huh. Awesome.

    Some other significant changes that were made which may have played a part (though I don't believe so) is basing my test directory off of this handy download:
    • http://people.apache.org/~geoff/Apache-Test-with-Devel-Cover.tar.gz
    And although that includes some curiosities that I hadn't tried, it didn't immediately help although may have in the long run -- I really don't know.

    Hope that helps someone out there.

    ---------
    perl -le '$.=[qw(104 97 124 124 116 97)];*p=sub{[@{$_[0]},(45)x 2]};*d=sub{[(45)x 2,@{$_[0]}]};print map{chr}@{p(d($.))}'
      Indeed, it seems almost nobody is using Apache::Test to test mod_perl modules, and much less people is adding Devel::Cover to the mix. I kept stumbling on stupid problems mostly because of really bad docs, (undocumented) missing dependencies, and such..

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://718830]
Approved by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (2)
As of 2024-03-19 07:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found