Fighting Safe for code coverage

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Fighting Safe for code coverage

Jeff Fearn-2
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=lists+s6506n84121h51@...>
Reply | Threaded
Open this post in threaded view
|

Re: Fighting Safe for code coverage

Dylan Hardison
What version of Devel::Cover and Safe? I can't reproduce here.

perl -MSafe\ 9999
perl -MDevel::Cover\ 9999

On Fri, Jun 3, 2016 at 6:03 AM, Jeff Fearn <[hidden email]> 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@...>
-
To view or change your list settings, click here:
<https://lists.bugzilla.org/cgi-bin/mj_wwwusr?user=lists+s6506n84121h51@...>
Reply | Threaded
Open this post in threaded view
|

Re: Fighting Safe for code coverage

Jeff Fearn-2
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 <[hidden email]> 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@...>
> -
> To view or change your list settings, click here:
> <https://lists.bugzilla.org/cgi-bin/mj_wwwusr?user=Jeff.Fearn@...>
>

-
To view or change your list settings, click here:
<https://lists.bugzilla.org/cgi-bin/mj_wwwusr?user=lists+s6506n84121h51@...>
Reply | Threaded
Open this post in threaded view
|

Re: Fighting Safe for code coverage

Jeff Fearn-2
On 4/06/2016 9:42 AM, Jeff Fearn wrote:

> 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 for the pointer, I've isolated it to the ComponentWatching
extension we lifted from BMO. Haven't determined the exact cause yet,
but touch `extension/ComponentWatching/disabled` allows Devel::Cover to
run again.

Cheers, Jeff.

-
To view or change your list settings, click here:
<https://lists.bugzilla.org/cgi-bin/mj_wwwusr?user=lists+s6506n84121h51@...>
Reply | Threaded
Open this post in threaded view
|

Re: Fighting Safe for code coverage

Jeff Fearn-2
On 4/06/2016 9:55 AM, Jeff Fearn wrote:

> On 4/06/2016 9:42 AM, Jeff Fearn wrote:
>> 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 for the pointer, I've isolated it to the ComponentWatching
> extension we lifted from BMO. Haven't determined the exact cause yet,
> but touch `extension/ComponentWatching/disabled` allows Devel::Cover to
> run again.

And solved, an unneeded reference to Bugzilla->bdh was added to the top
of db_schema_abstract_schema which causes some insanity.

Someone owes me a cider, Matt!

Cheers, Jeff.
-
To view or change your list settings, click here:
<https://lists.bugzilla.org/cgi-bin/mj_wwwusr?user=lists+s6506n84121h51@...>
Reply | Threaded
Open this post in threaded view
|

Re: Fighting Safe for code coverage

Jeff Fearn-2


On 4/06/2016 10:10, Jeff Fearn wrote:

> On 4/06/2016 9:55 AM, Jeff Fearn wrote:
>> On 4/06/2016 9:42 AM, Jeff Fearn wrote:
>>> 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 for the pointer, I've isolated it to the ComponentWatching
>> extension we lifted from BMO. Haven't determined the exact cause yet,
>> but touch `extension/ComponentWatching/disabled` allows Devel::Cover to
>> run again.
>
> And solved, an unneeded reference to Bugzilla->bdh was added to the
> top of db_schema_abstract_schema which causes some insanity.
>
> Someone owes me a cider, Matt!

Turns out it's not Matt, it's DKL!

https://github.com/mozilla/webtools-bmo-bugzilla/commit/634f31d6c64894bcf2f0788525e9a9286e9de314

Cheers, Jeff.
-
To view or change your list settings, click here:
<https://lists.bugzilla.org/cgi-bin/mj_wwwusr?user=lists+s6506n84121h51@...>