Skip Menu |

This queue is for tickets about the Test-Tester CPAN distribution.

Report information
The Basics
Id: 33645
Status: open
Priority: 0/
Queue: Test-Tester

People
Owner: Nobody in particular
Requestors: ANDK [...] cpan.org
Cc: FDALY [...] cpan.org
AdminCc:

Bug Information
Severity: Critical
Broken in: (no value)
Fixed in: (no value)



CC: FDALY [...] cpan.org
Subject: 0.77 through 0.79_01 break Test::Tester 0.106
Upgrading to Test-Simple-0.{77,78,79_01} breaks Test-Tester-0.106 which has many dependencies, so I'm rating this ticket as critical. Downgrading to 0.75 fixes this. But as we learned yesterday, 0.75 broke Test-Class, so downgrading to 0.74 seems appropriate. I have verified with bleadperl@33387 and 5.10.0. See http://www.nntp.perl.org/group/perl.cpan.testers/2008/02/msg1081602.html for the exact failures produced.
On Thu Feb 28 01:56:53 2008, ANDK wrote: Show quoted text
> Upgrading to Test-Simple-0.{77,78,79_01} breaks Test-Tester-0.106 which > has many dependencies, so I'm rating this ticket as critical. > > Downgrading to 0.75 fixes this. But as we learned yesterday, 0.75 broke > Test-Class, so downgrading to 0.74 seems appropriate. > > I have verified with bleadperl@33387 and 5.10.0. See > > http://www.nntp.perl.org/group/perl.cpan.testers/2008/02/msg1081602.html > > for the exact failures produced.
A bit of examination shows Test-Tester is failing because of $self->{TODO} in Test::Builder->todo(). This is blowing up because it's calling it as a class method. It is not. todo() gets called as a class method because it's calling it's own overridden ok() method as a class method. ok() is also not a class method. The root of the problem is this in Test::Tester::Capture. sub new { return __PACKAGE__; } As a subclass of Test::Builder, new() should be returning an object, not a class name. Previous versions of Test::Builder worked with Test::Tester by accident, the object methods used happened to not reference the Test::Builder object.
Subject: Re: [rt.cpan.org #33645] ok() is not a class method
Date: Thu, 28 Feb 2008 08:48:00 +0000
To: bug-Test-Tester [...] rt.cpan.org
From: "Fergal Daly" <fergal [...] esatclear.ie>
I'll try get a fix for this this evening. I didn't recieve the original failure report (yet...), F On 28/02/2008, Michael G Schwern via RT <bug-Test-Tester@rt.cpan.org> wrote: Show quoted text
> > Queue: Test-Tester > Ticket <URL: http://rt.cpan.org/Ticket/Display.html?id=33645 > > > On Thu Feb 28 01:56:53 2008, ANDK wrote:
> > Upgrading to Test-Simple-0.{77,78,79_01} breaks Test-Tester-0.106 which > > has many dependencies, so I'm rating this ticket as critical. > > > > Downgrading to 0.75 fixes this. But as we learned yesterday, 0.75 broke > > Test-Class, so downgrading to 0.74 seems appropriate. > > > > I have verified with bleadperl@33387 and 5.10.0. See > > > > http://www.nntp.perl.org/group/perl.cpan.testers/2008/02/msg1081602.html > > > > for the exact failures produced.
> > A bit of examination shows Test-Tester is failing because of > $self->{TODO} in Test::Builder->todo(). This is blowing up because it's > calling it as a class method. It is not. todo() gets called as a class > method because it's calling it's own overridden ok() method as a class > method. ok() is also not a class method. > > The root of the problem is this in Test::Tester::Capture. > > sub new > { > return __PACKAGE__; > } > > As a subclass of Test::Builder, new() should be returning an object, not > a class name. > > Previous versions of Test::Builder worked with Test::Tester by accident, > the object methods used happened to not reference the Test::Builder object. > > > >
Subject: Re: [rt.cpan.org #33645] ok() is not a class method
Date: Sat, 1 Mar 2008 22:33:51 +0000
To: bug-Test-Tester [...] rt.cpan.org
From: "Fergal Daly" <fergal [...] esatclear.ie>
Test::Test 0.107 is in CPAN's pipes. The root cause is that with old-style Test::Builder, for an inheriting class, it wasn't sensible to call the superclass constructor so I didn't. That was just fine for new-style for a long time too. The quick hack in 0.107 is to just return a blessed {} but that once more depends on the implementation of Test::Builder.The real fix is create a new CaptureNewStyle package and use that if we have new-style Test::Builder. I'm hoping this new package will just trivially inherit and that's all. I'm leaving this bug open until I've released the "real fix", F On 28/02/2008, Fergal Daly via RT <bug-Test-Tester@rt.cpan.org> wrote: Show quoted text
> > <URL: http://rt.cpan.org/Ticket/Display.html?id=33645 > > > I'll try get a fix for this this evening. > > I didn't recieve the original failure report (yet...), > > F > > On 28/02/2008, Michael G Schwern via RT <bug-Test-Tester@rt.cpan.org> wrote:
> > > > Queue: Test-Tester > > Ticket <URL: http://rt.cpan.org/Ticket/Display.html?id=33645 > > > > > On Thu Feb 28 01:56:53 2008, ANDK wrote:
> > > Upgrading to Test-Simple-0.{77,78,79_01} breaks Test-Tester-0.106 which > > > has many dependencies, so I'm rating this ticket as critical. > > > > > > Downgrading to 0.75 fixes this. But as we learned yesterday, 0.75 broke > > > Test-Class, so downgrading to 0.74 seems appropriate. > > > > > > I have verified with bleadperl@33387 and 5.10.0. See > > > > > > http://www.nntp.perl.org/group/perl.cpan.testers/2008/02/msg1081602.html > > > > > > for the exact failures produced.
> > > > A bit of examination shows Test-Tester is failing because of > > $self->{TODO} in Test::Builder->todo(). This is blowing up because it's > > calling it as a class method. It is not. todo() gets called as a class > > method because it's calling it's own overridden ok() method as a class > > method. ok() is also not a class method. > > > > The root of the problem is this in Test::Tester::Capture. > > > > sub new > > { > > return __PACKAGE__; > > } > > > > As a subclass of Test::Builder, new() should be returning an object, not > > a class name. > > > > Previous versions of Test::Builder worked with Test::Tester by accident, > > the object methods used happened to not reference the Test::Builder object. > > > > > > > >
> >
On Sat Mar 01 17:34:38 2008, fergal@esatclear.ie wrote: Show quoted text
> The root cause is that with old-style Test::Builder, for an inheriting > class, it wasn't sensible to call the superclass constructor so I > didn't. That was just fine for new-style for a long time too. > > The quick hack in 0.107 is to just return a blessed {} but that once > more depends on the implementation of Test::Builder.The real fix is > create a new CaptureNewStyle package and use that if we have new-style > Test::Builder. I'm hoping this new package will just trivially inherit > and that's all.
How about just calling $class->SUPER::create? Make a dependency on a high enough Test::Builder so that it exists. Patch attached.
--- Makefile.PL (revision 54978) +++ Makefile.PL (local) @@ -21,7 +21,9 @@ VERSION_FROM => $pm_file, INSTALLDIRS => 'perl', PREREQ_PM => { - 'Test::Builder' => 0, + # create() was introduced in Test-Simple 0.60 which + # contained Test::Builder 0.30. + 'Test::Builder' => 0.30, }, dist => { PREOP=> "rm -f README; pod2text -80 < $doc_file > README; cp -f README $dir-\$(VERSION); " --- lib/Test/Tester/Capture.pm (revision 54978) +++ lib/Test/Tester/Capture.pm (local) @@ -25,19 +25,10 @@ my @Test_Results = (); share(@Test_Results); my $Prem_Diag = {diag => ""}; share($Curr_Test); -sub new -{ - # Test::Tester::Capgture::new used to just return __PACKAGE__ - # because Test::Builder::new enforced it's singleton nature by - # return __PACKAGE__. That has since changed, Test::Builder::new now - # returns a blessed has and around version 0.78, Test::Builder::todo - # started wanting to modify $self. To cope with this, we now return - # a blessed hash. This is a short-term hack, the correct thing to do - # is to detect which style of Test::Builder we're dealing with and - # act appropriately. - +my $Builder; +sub new { my $class = shift; - return bless {}, $class; + return $Builder ||= $class->SUPER::create(@_); } sub ok {
Subject: Re: [rt.cpan.org #33645] ok() is not a class method
Date: Mon, 3 Mar 2008 00:58:50 +0000
To: bug-Test-Tester [...] rt.cpan.org
From: "Fergal Daly" <fergal [...] esatclear.ie>
On 02/03/2008, Michael G Schwern via RT <bug-Test-Tester@rt.cpan.org> wrote: Show quoted text
> On Sat Mar 01 17:34:38 2008, fergal@esatclear.ie wrote: >
> > The root cause is that with old-style Test::Builder, for an inheriting
> > class, it wasn't sensible to call the superclass constructor so I > > didn't. That was just fine for new-style for a long time too. > > > > The quick hack in 0.107 is to just return a blessed {} but that once > > more depends on the implementation of Test::Builder.The real fix is > > create a new CaptureNewStyle package and use that if we have new-style > > Test::Builder. I'm hoping this new package will just trivially inherit > > and that's all.
> > > How about just calling $class->SUPER::create? Make a dependency on a > high enough Test::Builder so that it exists. Patch attached.
I don't see a need to force dependency later Test::Builders but also it doesn't seem to be that simple. Apart from anything implementing my own copies of ok() and diag() instead of just inheriting/wrapping Test::Builder's is dumb with the new-style Test::Builder. I had a quick go at a version that takes advantage of the new-style stuff and ran into some difficulties that I didn't have time to resolve over the weekend. I think I had everything working except verifying that $Level has been set correctly. It didn't help that some of the stuff I did in this module makes no sense to me at all now. I'm afraid to rationalise it. I'm not quite sure if it had a genuine purpose or was just me being stupid. I suppose running my tests against a variety of Test::Simples should help there. I should get a better version during the week, F