Skip Menu |
 

This queue is for tickets about the DBD-mysql CPAN distribution.

Report information
The Basics
Id: 91047
Status: resolved
Priority: 0/
Queue: DBD-mysql

People
Owner: CAPTTOFU [...] cpan.org
Requestors: jeppe [...] ioslo.net
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 4.025
Fixed in: 4.030_01



Subject: t/rt83494-quotes-comments.t fails without a database connection
Download (untitled) / with headers
text/plain 119b
All the other tests skip when we don't have a database connection, but t/rt83494-quotes-comments.t doesn't check this.
Download (untitled) / with headers
text/plain 1.8k
On Fri Nov 29 03:52:11 2013, jeppe@ioslo.net wrote: Show quoted text
> All the other tests skip when we don't have a database connection, but > t/rt83494-quotes-comments.t doesn't check this.
For 4.025 Patrick added the below commit to git: basically it aborts all testing if connecting to the database fails with $DBI::err == 1045 -- this is when login fails due to bad username or password. but if there is no server on localhost, or if the server is stopped, there is no $DBI::err == 1045 so the 'old' behaviour applies which means all tests are skipped, as mentioned, all tests except the quotes-comments test. There also is a side-effect. In the previous situation, before bailout was called the tests were SKIPPED which means that the tests still exited 'succesful'. Currently, if bailout is called, the tests are considered failed and it will not install your module. I'd propose remove the bailout because of this reason, and add the skip part to the quotes text. @Patrick: do you agree? -- Mike https://github.com/perl5-dbi/DBD-mysql/commit/580d8de9f78166635ed758716d0b5605097645a0 commit 580d8de9f78166635ed758716d0b5605097645a0 Author: Patrick Galbraith <patg@patg.net> Date: Fri Oct 25 03:39:56 2013 -0400 Bail if connect fails early on, per suggestion RT31823 diff --git a/t/10connect.t b/t/10connect.t index d63d192..9c08e05 100644 --- a/t/10connect.t +++ b/t/10connect.t @@ -15,9 +15,12 @@ require 'lib.pl'; my $dbh; eval {$dbh= DBI->connect($test_dsn, $test_user, $test_password, { RaiseError => 1, PrintError => 1, AutoCommit => 0 });}; - if ($@) { - plan skip_all => "ERROR: $DBI::errstr Can't continue test"; + # https://rt.cpan.org/Ticket/Display.html?id=31823 + if ($DBI::err == 1045) { + Test::More::BAIL_OUT("ERROR: $DBI::errstr\nAborting remaining tests!"); + } + plan skip_all => "ERROR: $DBI::errstr $DBI::err Can't continue test"; } plan tests => 2;
Download (untitled) / with headers
text/plain 188b
Thanks for the bug report! I fixed this in https://github.com/perl5-dbi/DBD-mysql/commit/721723fa878479dfec2cfe8eca31538f154d710d and in 4.030_01 which is to be found on CPAN. -- Michiel


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.