Skip Menu |

This queue is for tickets about the Rose-DBx-Garden-Catalyst CPAN distribution.

Report information
The Basics
Id: 41769
Status: resolved
Priority: 0/
Queue: Rose-DBx-Garden-Catalyst

People
Owner: Nobody in particular
Requestors: he [...] NetBSD.org
Cc:
AdminCc:

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



Subject: Bug/typo in test?
Date: Wed, 17 Dec 2008 02:39:47 +0100 (CET)
To: bug-Rose-DBx-Garden-Catalyst [...] rt.cpan.org
From: Havard Eidnes <he [...] NetBSD.org>
Hi, I'm updating the perl package for this module in NetBSD's pkgsrc, and notice that the selftest fails, even after I've fixed the invocation of sqlite3 in the build environment pkgsrc sets up. There appears to be a logic error/typo (this is version 0.12): --- t/lib/MyDB.pm.orig 2008-12-17 02:30:18.000000000 +0100 +++ t/lib/MyDB.pm @@ -27,7 +27,7 @@ $db = Path::Class::File->new( $base_pat # create the db if it does not yet exist if ( !-s $db ) { - system("sqlite3 $db < $sql") and die "can't create $db with $sql: $!"; + system("sqlite3 $db < $sql") or die "can't create $db with $sql: $!"; } if ( !$db or !-s $db ) { When this patch is applied, the tests succeed, but with a lot of crud on stderr, such as t/01-rdgc.........2/6 Argument "t/lib/MyRDGC/root/static/js/crud.js" isn't numeric in numeric eq (==) at /usr/pkg/lib/perl5/5.10.0/File/Copy.pm line 70. Argument "/usr/pkg/lib/perl5/vendor_perl/5.10.0/CatalystX/CRUD/YUI..." isn't numeric in numeric eq (==) at /usr/pkg/lib/perl5/5.10.0/File/Copy.pm line 70. which is repeated a number of times, don't know what's up with that; maybe you have an idea? Regards, - Håvard
Subject: Re: [rt.cpan.org #41769] Bug/typo in test?
Date: Tue, 16 Dec 2008 20:27:00 -0600
To: bug-Rose-DBx-Garden-Catalyst [...] rt.cpan.org
From: Peter Karman <peter [...] peknet.com>
Havard Eidnes via RT wrote on 12/16/08 7:40 PM: Show quoted text
> Tue Dec 16 20:40:06 2008: Request 41769 was acted upon. > Transaction: Ticket created by he@NetBSD.org > Queue: Rose-DBx-Garden-Catalyst > Subject: Bug/typo in test? > Broken in: (no value) > Severity: (no value) > Owner: Nobody > Requestors: he@NetBSD.org > Status: new > Ticket <URL: http://rt.cpan.org/Ticket/Display.html?id=41769 > > > > Hi, > > I'm updating the perl package for this module in NetBSD's pkgsrc, > and notice that the selftest fails, even after I've fixed the > invocation of sqlite3 in the build environment pkgsrc sets up. > There appears to be a logic error/typo (this is version 0.12): > > --- t/lib/MyDB.pm.orig 2008-12-17 02:30:18.000000000 +0100 > +++ t/lib/MyDB.pm > @@ -27,7 +27,7 @@ $db = Path::Class::File->new( $base_pat > > # create the db if it does not yet exist > if ( !-s $db ) { > - system("sqlite3 $db < $sql") and die "can't create $db with $sql: $!"; > + system("sqlite3 $db < $sql") or die "can't create $db with $sql: $!"; > } >
that's wrong. system() returns a non-zero value if it fails, which is unlike most other Perl function calls. So the 'and' is correct. If there's a problem with a raw system() I may need to use IPC::Cmd or similar, but those use system() underneath iirc. Show quoted text
> if ( !$db or !-s $db ) { > > When this patch is applied, the tests succeed, but with a lot of > crud on stderr, such as > > t/01-rdgc.........2/6 Argument "t/lib/MyRDGC/root/static/js/crud.js" isn't numeric in numeric eq (==) at /usr/pkg/lib/perl5/5.10.0/File/Copy.pm line 70. > Argument "/usr/pkg/lib/perl5/vendor_perl/5.10.0/CatalystX/CRUD/YUI..." isn't numeric in numeric eq (==) at /usr/pkg/lib/perl5/5.10.0/File/Copy.pm line 70. > > which is repeated a number of times, don't know what's up with > that; maybe you have an idea?
I have fixes for those issues in svn already. I just pushed 0.13 to CPAN with those fixes and a switch to IPC::Cmd for the system() issue above. Try that and see. -- Peter Karman . http://peknet.com/ . peter@peknet.com
Subject: Re: [rt.cpan.org #41769] Bug/typo in test?
Date: Sat, 20 Dec 2008 17:07:50 +0100 (CET)
To: bug-Rose-DBx-Garden-Catalyst [...] rt.cpan.org
From: Havard Eidnes <he [...] NetBSD.org>
Show quoted text
> > I'm updating the perl package for this module in NetBSD's pkgsrc, > > and notice that the selftest fails, even after I've fixed the > > invocation of sqlite3 in the build environment pkgsrc sets up. > > There appears to be a logic error/typo (this is version 0.12): > > > > --- t/lib/MyDB.pm.orig 2008-12-17 02:30:18.000000000 +0100 > > +++ t/lib/MyDB.pm > > @@ -27,7 +27,7 @@ $db = Path::Class::File->new( $base_pat > > > > # create the db if it does not yet exist > > if ( !-s $db ) { > > - system("sqlite3 $db < $sql") and die "can't create $db with $sql: $!"; > > + system("sqlite3 $db < $sql") or die "can't create $db with $sql: $!"; > > }
> > that's wrong. system() returns a non-zero value if it fails, which is unlike > most other Perl function calls. So the 'and' is correct. > > If there's a problem with a raw system() I may need to use IPC::Cmd or similar, > but those use system() underneath iirc.
I found out what the actual problem was, after updating to 0.13, and running the test by hand (without the test harness) so that I could see all the output from the test. The problem is that the t/rdgc.sql input file has several "drop table xxx;" for several nonexistent tables, and sqlite3 version 3.6.6.2 appears to think that this is an error, and does an "exit(9)" after completing it's task and printing these error messages: SQL error near line 3: no such table: addresses SQL error near line 13: no such table: suppliers SQL error near line 24: no such table: manufacturers SQL error near line 35: no such table: products SQL error near line 48: no such table: locations SQL error near line 59: no such table: stocks SQL error near line 72: no such table: customers SQL error near line 83: no such table: invoices SQL error near line 95: no such table: lines Commenting out all the "drop table xxx;" statements from t/rdgc.sql fixed the problem. Regards, - Håvard
Subject: Re: [rt.cpan.org #41769] Bug/typo in test?
Date: Sat, 20 Dec 2008 20:19:47 -0600
To: bug-Rose-DBx-Garden-Catalyst [...] rt.cpan.org
From: Peter Karman <peter [...] peknet.com>
Havard Eidnes via RT wrote on 12/20/08 10:07 AM: Show quoted text
> The problem is that the t/rdgc.sql input file has several "drop table > xxx;" for several nonexistent tables, and sqlite3 version 3.6.6.2 > appears to think that this is an error, and does an "exit(9)" after > completing it's task and printing these error messages:
thanks. I've added conditional 'if exists <table>' statements to rdgc.sql in svn; it'll be in 0.14. -- Peter Karman . http://peknet.com/ . peter@peknet.com