Fighting Safe for code coverage

Jeff Fearn jefffearn at gmail.com
Fri Jun 3 23:42:58 UTC 2016


On 3/06/2016 10:21 PM, Dylan Hardison wrote:
> What version of Devel::Cover and Safe? I can't reproduce here.
>
> perl -MSafe\ 9999
> perl -MDevel::Cover\ 9999

Safe 2.37
Devel::Cover 1.17
perl 5.20.3

Oh nasty, I ran this on a clean upstream and it works fine, I guess I 
need to go diving in to our patches and extensions >_<

Thanks, Jeff.

> On Fri, Jun 3, 2016 at 6:03 AM, Jeff Fearn <jefffearn at gmail.com> wrote:
>> 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.
>>
>>
>> -
>> To view or change your list settings, click here:
>> <https://lists.bugzilla.org/cgi-bin/mj_wwwusr?user=dylan@mozilla.com>
> -
> To view or change your list settings, click here:
> <https://lists.bugzilla.org/cgi-bin/mj_wwwusr?user=Jeff.Fearn@gmail.com>
>




More information about the developers mailing list