Skip Menu |

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

Report information
The Basics
Id: 45536
Status: resolved
Priority: 0/
Queue: Test-Database

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

Bug Information
Severity: Important
Broken in: 0.99_03
Fixed in: (no value)



Subject: When unknown driver is specified in ~/.test-database, use Test::Database fails
If the file ~/.test-database contains single line driver = Nonexistent running $ perl -MTest::Database -e 1 fails with Can't locate Test/Database/Driver/Nonexistent.pm in @INC (@INC contains: /usr/local/lib/perl5/site_perl/5.10.0/i386-linux-thread-multi /usr/local/lib/perl5/site_perl/5.10.0 /usr/lib/perl5/vendor_perl/5.10.0/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.10.0 /usr/lib/perl5/vendor_perl /usr/lib/perl5/5.10.0/i386-linux-thread-multi /usr/lib/perl5/5.10.0 /usr/lib/perl5/site_perl .) at (eval 13) line 3. at /usr/local/lib/perl5/site_perl/5.10.0/Test/Database.pm line 117 Compilation failed in require. BEGIN failed--compilation aborted. I think that just doing use should not fail because of (old) content of ~/.test-database. The module should parse the file (if it insists on parsing it upon use), try to load the drivers/DBD's, but if any of that fails, the information about failed attempts could be available somewhere but the use should succeed. Similar problem happens if you have driver = Pg specified there but you do not have DBD::Pg installed: install_driver(Pg) failed: Can't locate DBD/Pg.pm in @INC (@INC contains: /usr/local/lib/perl5/site_perl/5.10.0/i386-linux-thread-multi /usr/local/lib/perl5/site_perl/5.10.0 /usr/lib/perl5/vendor_perl/5.10.0/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.10.0 /usr/lib/perl5/vendor_perl /usr/lib/perl5/5.10.0/i386-linux-thread-multi /usr/lib/perl5/5.10.0 /usr/lib/perl5/site_perl .) at (eval 14) line 3. Perhaps the DBD::Pg perl module hasn't been fully installed, or perhaps the capitalisation of 'Pg' isn't right. Available drivers: DBM, ExampleP, File, Gofer, Proxy, Sponge. at /usr/local/lib/perl5/site_perl/5.10.0/Test/Database/Driver.pm line 39 Compilation failed in require. BEGIN failed--compilation aborted.
On Tue Apr 28 15:51:20 2009, JANPAZ wrote: Show quoted text
> If the file ~/.test-database contains single line > > driver = Nonexistent > > running > > $ perl -MTest::Database -e 1 > > fails with > > Can't locate Test/Database/Driver/Nonexistent.pm in @INC (@INC contains:
The "driver = $driver" configuration line was removed from Test::Database version 1.00. Something similar will be added to version 1.02. Currently, any line starting with "driver = " is an error. When I put drivers back in the config file, I'll try to remember to gracefully handle bad driver/dsn configuration. Thanks for your report, -- BooK