Discussion:
Apache-Test and Devel::Cover
Geoffrey Young
2005-11-01 13:57:03 UTC
Permalink
hi all :)

I just commited a patch to Apache-Test in svn that removes all the
additional work involved with getting Devel::Cover to work for server side
tests. now a simple 'make testcover' should be all you need to do to get
coverage results from code within handler() subroutines - no more adding
modperl_extra.pl entries or other associated foo.

so, for the few here interested in this kind of thing, I'd like to hear
people's test results for completeness sake. on my own system (which is
slowly dying), I get random core dumps and Devel::Cover failures both in the
way I used to do it and the way it works now, so in that sense things work
out "the same." but if other people who used to have stuff working now have
increased problems I'd love to hear about it. but hopefully all this patch
does is lower the barrier to getting coverage in the apache world.

for those not terribly svn savvy, you can get Apache-Test from svn like so

$ svn checkout \
http://svn.apache.org/repos/asf/perl/Apache-Test/trunk Apache-Test
thanks, and enjoy.

--Geoff
Geoffrey Young
2005-11-01 20:25:31 UTC
Permalink
Nice work, Geoff
:)
1)
% make testcover
Cannot run testcover action unless Devel::Cover is installed
and after installing Devel::Cover it still gives the same error, since
it's hardcoded in Makefile.PL. May be adding a check and suggesting to
rebuild Makefile if Devel::Cover is now installed?
ok.
All tests successful, 1 test skipped.
Files=7, Tests=22, 140 wallclock secs (134.28 cusr + 5.51 csys = 139.79
CPU)
server localhost:8529 shutdown
make[1]: Leaving directory `/home/stas/apache.org/Apache-Test'
make: cover: Command not found
make: [testcover] Error 127 (ignored)
I don't use a standard perl, so 'cover' is not in the path. So it should
probably do which(cover) and run it only then? Also could check the
directory perl lives and add that to PATH, since that's where 'cover'
lives if not installed global-wise.
I don't use a standard perl either, so cover is one of those things I need
to add to my path.

really, I'm not sure how much I want to run through hoops for people wrt
stuff like this - if you're a developer and you care about coverage you have
Devel::Cover (and its components) installed and ready for use, otherwise you
don't. almost nobody will be running testcover who doesn't have things
installed properly, so I'm not sure it makes too much sense to go poking
around looking for stuff.
3)
I do get segfaults and they are quite inconsistent. Even on
Apache-Test's test suite. Of course this probably has nothing to do with
your work, since have happened before as well. I wonder whether
Devel::Cover is just as unstable under plain perl.
under plain perl it works out very nicely. I think something about the
embedded perl environment is causing problems. actually, until a recent
version (0.48 IIRC) it didn't work under mod_perl at all. my own personal
experience wrt mod_perl is that it seems to work ok with mp1. the mp2 +
Devel::Cover combination behaves very erratically, but I have better luck
with unthreaded perls and prefork than threaded perls (and horrible results
with worker, if it works at all which I don't think it does).

but we're getting closer each time, and paul has been outstanding creating
D::C at all, so there's not much to complain about :)

--Geoff
Stas Bekman
2005-11-01 23:26:24 UTC
Permalink
Post by Geoffrey Young
All tests successful, 1 test skipped.
Files=7, Tests=22, 140 wallclock secs (134.28 cusr + 5.51 csys = 139.79 CPU)
server localhost:8529 shutdown
make[1]: Leaving directory `/home/stas/apache.org/Apache-Test'
make: cover: Command not found
make: [testcover] Error 127 (ignored)
I don't use a standard perl, so 'cover' is not in the path. So it should
probably do which(cover) and run it only then? Also could check the
directory perl lives and add that to PATH, since that's where 'cover'
lives if not installed global-wise.
I don't use a standard perl either, so cover is one of those things I need
to add to my path.
really, I'm not sure how much I want to run through hoops for people wrt
stuff like this - if you're a developer and you care about coverage you have
Devel::Cover (and its components) installed and ready for use, otherwise you
don't. almost nobody will be running testcover who doesn't have things
installed properly, so I'm not sure it makes too much sense to go poking
around looking for stuff.
Sorry Geoff, but my things are installed properly. It's just that you
shouldn't run an application that's not there. How hard it is to run
which("cover") and run the executable only if found.
Post by Geoffrey Young
3)
I do get segfaults and they are quite inconsistent. Even on
Apache-Test's test suite. Of course this probably has nothing to do with
your work, since have happened before as well. I wonder whether
Devel::Cover is just as unstable under plain perl.
under plain perl it works out very nicely. I think something about the
embedded perl environment is causing problems. actually, until a recent
version (0.48 IIRC) it didn't work under mod_perl at all. my own personal
experience wrt mod_perl is that it seems to work ok with mp1. the mp2 +
Devel::Cover combination behaves very erratically, but I have better luck
with unthreaded perls and prefork than threaded perls (and horrible results
with worker, if it works at all which I don't think it does).
but we're getting closer each time, and paul has been outstanding creating
D::C at all, so there's not much to complain about :)
It's true that there is not much to complain about other than it just
doesn't work. I get segfaults on any apache based test suite, even with
prefork/non-threaded perl so it's of no use whatsover :(
--
_____________________________________________________________
Stas Bekman mailto:***@stason.org http://stason.org/
MailChannels: Assured Messaging(TM) http://mailchannels.com/
The "Practical mod_perl" book http://modperlbook.org/
http://perl.apache.org/ http://perl.org/ http://logilune.com/
Stas Bekman
2005-11-01 19:35:03 UTC
Permalink
Post by Geoffrey Young
hi all :)
I just commited a patch to Apache-Test in svn that removes all the
additional work involved with getting Devel::Cover to work for server side
tests. now a simple 'make testcover' should be all you need to do to get
coverage results from code within handler() subroutines - no more adding
modperl_extra.pl entries or other associated foo.
so, for the few here interested in this kind of thing, I'd like to hear
people's test results for completeness sake. on my own system (which is
slowly dying), I get random core dumps and Devel::Cover failures both in the
way I used to do it and the way it works now, so in that sense things work
out "the same." but if other people who used to have stuff working now have
increased problems I'd love to hear about it. but hopefully all this patch
does is lower the barrier to getting coverage in the apache world.
for those not terribly svn savvy, you can get Apache-Test from svn like so
$ svn checkout \
http://svn.apache.org/repos/asf/perl/Apache-Test/trunk Apache-Test
thanks, and enjoy.
--Geoff
Nice work, Geoff

A few issues:

1)

% make testcover
Cannot run testcover action unless Devel::Cover is installed

and after installing Devel::Cover it still gives the same error, since
it's hardcoded in Makefile.PL. May be adding a check and suggesting to
rebuild Makefile if Devel::Cover is now installed?

2) at the end of run it gives:

All tests successful, 1 test skipped.
Files=7, Tests=22, 140 wallclock secs (134.28 cusr + 5.51 csys = 139.79 CPU)
server localhost:8529 shutdown
make[1]: Leaving directory `/home/stas/apache.org/Apache-Test'
make: cover: Command not found
make: [testcover] Error 127 (ignored)

I don't use a standard perl, so 'cover' is not in the path. So it should
probably do which(cover) and run it only then? Also could check the
directory perl lives and add that to PATH, since that's where 'cover'
lives if not installed global-wise.

3)

I do get segfaults and they are quite inconsistent. Even on Apache-Test's
test suite. Of course this probably has nothing to do with your work,
since have happened before as well. I wonder whether Devel::Cover is just
as unstable under plain perl.
--
_____________________________________________________________
Stas Bekman mailto:***@stason.org http://stason.org/
MailChannels: Assured Messaging(TM) http://mailchannels.com/
The "Practical mod_perl" book http://modperlbook.org/
http://perl.apache.org/ http://perl.org/ http://logilune.com/
Loading...