no coverage for Catalyst app under Starman #50

Open
daxim opened this Issue Mar 21, 2013 · 1 comment

Projects

None yet

2 participants

@daxim
daxim commented Mar 21, 2013

Steps to reproduce

cpanm Catalyst::Devel Starman

catalyst.pl MyApp

cd MyApp

since a server runs forever, provide a hook for D::C to write out coverage data

perl -i -lpe's/sub index/sub stop :Local { exit };  # hard linefeed here
sub index/' lib/MyApp/Controller/Root.pm

launch server

starman -Ilib -MDevel::Cover=-select,MyApp myapp.psgi

wait here 10s for the server/workers to prefork

------- in another shell:

------- exercise MyApp::Controller::Root::index

curl http://localhost:5000

------- exit to flush coverage db

curl http://localhost:5000/stop

kill server

^C

make report

cover

Expected Result

---------------------------- ------ ------ ------ ------ ------ ------ ------
File                           stmt   bran   cond    sub    pod   time  total
---------------------------- ------ ------ ------ ------ ------ ------ ------
lib/MyApp.pm                  100.0    n/a    n/a  100.0    n/a   20.6  100.0
lib/MyApp/Controller/Root.pm   88.5    n/a    n/a   90.9   75.0   72.3   87.8
myapp.psgi                    100.0    n/a    n/a  100.0    n/a    0.4  100.0
Total                          92.5    n/a    n/a   95.0   75.0  100.0   92.2
---------------------------- ------ ------ ------ ------ ------ ------ ------

Actual result

---------------------------- ------ ------ ------ ------ ------ ------ ------ ------
File                           stmt   bran   path   cond    sub    pod   time  total
---------------------------- ------ ------ ------ ------ ------ ------ ------ ------
Total                           n/a    n/a    n/a    n/a    n/a    n/a    n/a    n/a
---------------------------- ------ ------ ------ ------ ------ ------ ------ ------

Note: the stand-alone server (HTTP::Server::PSGI) works.

perl -MDevel::Cover=-select,MyApp script/myapp_server.pl

@pjcj
Owner
pjcj commented Aug 3, 2015

Work on this is in the opfreehook branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment