Fighting Safe for code coverage

Jeff Fearn jefffearn at gmail.com
Fri Jun 3 10:03:12 UTC 2016


Hi, I'm trying to get some code coverage metrics and running in to an
issue where Safe is preventing Devel::Cover from loading properly ...
aiui anyway :) Has anyone got Devel::Cover working with the upstream
tests? I've tried every option to Safe I've been able to find and it's
not changed anything :(


This is a start to getting some unit tests in to our CI system to run
before integration testing.

Just prove:


$ prove t/013dbschema.t
t/013dbschema.t .. ok
All tests successful.
Files=1, Tests=123,  1 wallclock secs ( 0.03 usr  0.01 sys +  0.76 cusr
0.04 csys =  0.84 CPU)
Result: PASS

excellent, but:

$ HARNESS_PERL_SWITCHES=-MDevel::Cover prove t/013dbschema.t
t/013dbschema.t .. Can't locate object method "digest" via package
"Devel::Cover::DB::Structure" (perhaps you forgot to load
"Devel::Cover::DB::Structure"?) at
/usr/lib64/perl5/vendor_perl/Devel/Cover/DB/Digests.pm line 66.
No language defines the string 'error_localconfig_read' at
Bugzilla/Install/Localconfig.pm line 137.
BEGIN failed--compilation aborted at t/013dbschema.t line 65.
t/013dbschema.t .. Dubious, test returned 255 (wstat 65280, 0xff00)
No subtests run

Test Summary Report
-------------------
t/013dbschema.t (Wstat: 65280 Tests: 0 Failed: 0)
   Non-zero exit status: 255
   Parse errors: No plan found in TAP output
Files=1, Tests=0, 13 wallclock secs ( 0.03 usr  0.00 sys + 12.52 cusr
0.16 csys = 12.71 CPU)


I added a warn to get the real error:


$ git diff Bugzilla/Install/Localconfig.pm
diff --git a/Bugzilla/Install/Localconfig.pm
b/Bugzilla/Install/Localconfig.pm
index 72c26a4..b6cf8ba 100644
--- a/Bugzilla/Install/Localconfig.pm
+++ b/Bugzilla/Install/Localconfig.pm
@@ -134,6 +134,7 @@ sub read_localconfig {
          $s->rdo($filename);
          if ($@ || $!) {
              my $err_msg = $@ ? $@ : $!;
+           warn $err_msg;
              die install_string('error_localconfig_read',
                      { error => $err_msg, localconfig => $filename }), 
"\n";
          }

The rest of the tests work fine. I've also tried ignoring the file, but
I couldn't get any of the +/-ignore options to actually ignore this file.

Help me Obiwan!


Cheers, Jeff.





More information about the developers mailing list