Thread: Re: TAP / recovery-test fs-level backups, psql enhancements etc

Re: TAP / recovery-test fs-level backups, psql enhancements etc

From
Alvaro Herrera
Date:
Tom Lane wrote:
> I wrote:
> > Can't use string ("Test::Builder") as a HASH ref while "strict refs" in use at /usr/share/perl5/Test/Builder.pm
line1798.
 
> 
> > The referenced line number is the end of the file,
> 
> Oh, scratch that; I was looking at the wrong file.  Actually,
> /usr/share/perl5/Test/Builder.pm has
> 
> sub details {
>     my $self = shift;
>     return @{ $self->{Test_Results} };
> }
> 
> and line 1798 is the "return" statement in that.  I still lack enough
> Perl-fu to decipher this, though.

I think it's complaining about being called as a class method.  Perhaps
this would work:

+    foreach my $detail (Test::More->builder->details())

-- 
Álvaro Herrera                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services



Re: TAP / recovery-test fs-level backups, psql enhancements etc

From
Michael Paquier
Date:
On Wed, Mar 2, 2016 at 2:18 PM, Alvaro Herrera <alvherre@2ndquadrant.com> wrote:
> Tom Lane wrote:
>> I wrote:
>> > Can't use string ("Test::Builder") as a HASH ref while "strict refs" in use at /usr/share/perl5/Test/Builder.pm
line1798. 
>>
>> > The referenced line number is the end of the file,
>>
>> Oh, scratch that; I was looking at the wrong file.  Actually,
>> /usr/share/perl5/Test/Builder.pm has
>>
>> sub details {
>>     my $self = shift;
>>     return @{ $self->{Test_Results} };
>> }
>>
>> and line 1798 is the "return" statement in that.  I still lack enough
>> Perl-fu to decipher this, though.
>
> I think it's complaining about being called as a class method.  Perhaps
> this would work:
>
> +       foreach my $detail (Test::More->builder->details())

Yes, that's the problem. Instead of using details(), summary() is
enough actually. And it is enough to let caller know the failure when
just one test has been found as not passing. See attached.
--
Michael

Attachment

Re: TAP / recovery-test fs-level backups, psql enhancements etc

From
Craig Ringer
Date:
On 2 March 2016 at 13:22, Michael Paquier <michael.paquier@gmail.com> wrote:
On Wed, Mar 2, 2016 at 2:18 PM, Alvaro Herrera <alvherre@2ndquadrant.com> wrote:
> Tom Lane wrote:
>> I wrote:
>> > Can't use string ("Test::Builder") as a HASH ref while "strict refs" in use at /usr/share/perl5/Test/Builder.pm line 1798.
>>
>> > The referenced line number is the end of the file,
>>
>> Oh, scratch that; I was looking at the wrong file.  Actually,
>> /usr/share/perl5/Test/Builder.pm has
>>
>> sub details {
>>     my $self = shift;
>>     return @{ $self->{Test_Results} };
>> }
>>
>> and line 1798 is the "return" statement in that.  I still lack enough
>> Perl-fu to decipher this, though.
>
> I think it's complaining about being called as a class method.  Perhaps
> this would work:
>
> +       foreach my $detail (Test::More->builder->details())

Yes, that's the problem. Instead of using details(), summary() is
enough actually. And it is enough to let caller know the failure when
just one test has been found as not passing. See attached.

Thanks.

I'm setting up a container with Debian Wheezy, which looks old enough to test proposed framework changes, so I'll be able to test future patches against a real Perl 5.8.

--
 Craig Ringer                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services

Re: TAP / recovery-test fs-level backups, psql enhancements etc

From
Tom Lane
Date:
Michael Paquier <michael.paquier@gmail.com> writes:
> Yes, that's the problem. Instead of using details(), summary() is
> enough actually. And it is enough to let caller know the failure when
> just one test has been found as not passing. See attached.

This one works for me on RHEL6.  Pushed; we'll see if the older
buildfarm members like it.
        regards, tom lane



Re: TAP / recovery-test fs-level backups, psql enhancements etc

From
Tom Lane
Date:
I wrote:
> Michael Paquier <michael.paquier@gmail.com> writes:
>> Yes, that's the problem. Instead of using details(), summary() is
>> enough actually. And it is enough to let caller know the failure when
>> just one test has been found as not passing. See attached.

> This one works for me on RHEL6.  Pushed; we'll see if the older
> buildfarm members like it.

I don't normally run the TAP tests on "prairiedog", because it's
too $!*&@ slow, but trying that manually seems to work.  That's
the Perl 5.8.6 that Apple shipped with OS X 10.4 ... if there's
anything older in our buildfarm, I don't know about it.
        regards, tom lane