Skip Menu |
 

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

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

People
Owner: Nobody in particular
Requestors: michael.leahy1 [...] comcast.net
Cc:
AdminCc:

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



Subject: Abort tests quickly if connect fails
Date: Sat, 22 Dec 2007 01:23:09 -0500
To: bug-DBD-mysql [...] rt.cpan.org
From: Michael Leahy <michael.leahy1 [...] comcast.net>
Download (untitled) / with headers
text/plain 668b
The file t/10connect.t has a test to determine if we can connect to the server. If this test fails, most of the remaining tests in the test suite will fail, won't they? Would it make sense to abort the tests immediately using Test::More::BAIL_OUT() if the connection cannot be established (in the case of incorrect password, for instance)? my $dbh= DBI->connect($test_dsn, $test_user, $test_password, { RaiseError => 0, PrintError => 1, AutoCommit => 0 }); if (!defined $dbh) { BAIL_OUT( "Connect to database failed, aborting remaining tests." ); } ok(defined $dbh, "Connected to database"); ok($dbh->disconnect()); Thanks, --Michael
Download (untitled) / with headers
text/plain 825b
Thank you! Excellent suggestion! On Sat Dec 22 01:24:30 2007, michael.leahy1@comcast.net wrote: Show quoted text
> The file t/10connect.t has a test to determine if we can connect to > the > server. If this test fails, most of the remaining tests in the test > suite > will fail, won't they? > > Would it make sense to abort the tests immediately using > Test::More::BAIL_OUT() if the connection cannot be established (in the > case > of incorrect password, for instance)? > > > > my $dbh= DBI->connect($test_dsn, $test_user, $test_password, > { RaiseError => 0, PrintError => 1, AutoCommit > => 0 }); > > if (!defined $dbh) > { > BAIL_OUT( "Connect to database failed, aborting remaining tests." ); > } > > ok(defined $dbh, "Connected to database"); > > ok($dbh->disconnect()); > > > Thanks, > --Michael
suggestion taken, fix applied 4.025
Subject: Re: [rt.cpan.org #31823] Abort tests quickly if connect fails
Date: Tue, 29 Oct 2013 15:39:01 -0400
To: bug-DBD-mysql [...] rt.cpan.org
From: Michael Leahy <michael.leahy1 [...] comcast.net>
Thanks, Patrick… this report was so old I had completely forgotten about it. Glad it was still helpful! --Michael On Oct 27, 2013, at 10:15 AM, Patrick Galbraith via RT wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=31823 > > > Thank you! Excellent suggestion! > > On Sat Dec 22 01:24:30 2007, michael.leahy1@comcast.net wrote:
>> The file t/10connect.t has a test to determine if we can connect to >> the >> server. If this test fails, most of the remaining tests in the test >> suite >> will fail, won't they? >> >> Would it make sense to abort the tests immediately using >> Test::More::BAIL_OUT() if the connection cannot be established (in the >> case >> of incorrect password, for instance)? >> >> >> >> my $dbh= DBI->connect($test_dsn, $test_user, $test_password, >> { RaiseError => 0, PrintError => 1, AutoCommit >> => 0 }); >> >> if (!defined $dbh) >> { >> BAIL_OUT( "Connect to database failed, aborting remaining tests." ); >> } >> >> ok(defined $dbh, "Connected to database"); >> >> ok($dbh->disconnect()); >> >> >> Thanks, >> --Michael
> > >
Download (untitled) / with headers
text/plain 224b
On 2013-10-27 10:21:25, CAPTTOFU wrote: Show quoted text
> suggestion taken, fix applied 4.025
Unfortunately the test suite fails now completely if the test database cannot be reached. Previously this was not the case. Regards, Slaven
Subject: Re: [rt.cpan.org #31823] Abort tests quickly if connect fails
Date: Thu, 7 Nov 2013 11:39:24 +0000
To: bug-DBD-mysql [...] rt.cpan.org
From: Zefram <zefram [...] fysh.org>
Download (untitled) / with headers
text/plain 109b
Attached patch fixes the present test failure. Only one test script is missing the skipping logic. -zefram
Download test_skip.patch
text/x-diff 562b

Message body is not shown because sender requested not to inline it.

RT-Send-CC: zefram [...] fysh.org
Download (untitled) / with headers
text/plain 132b
On 2013-10-27 10:21:25, CAPTTOFU wrote: Show quoted text
> suggestion taken, fix applied 4.025
Please revert this change, and apply zefram's patch.
Download (untitled) / with headers
text/plain 400b
On 2014-11-19 16:18:59, SREZIC wrote: Show quoted text
> On 2013-10-27 10:21:25, CAPTTOFU wrote:
> > suggestion taken, fix applied 4.025
> > Please revert this change, and apply zefram's patch.
Ah, zefram's patch is already applied. So the only thing left is to revert the change in 10connect.t, e.g. using https://cpan.metacpan.org/authors/id/S/SR/SREZIC/patches/DBD-mysql-4.028-RT31823.patch Regards, Slaven
Download (untitled) / with headers
text/plain 485b
On 2014-11-19 16:36:29, SREZIC wrote: Show quoted text
> On 2014-11-19 16:18:59, SREZIC wrote:
> > On 2013-10-27 10:21:25, CAPTTOFU wrote:
> > > suggestion taken, fix applied 4.025
> > > > Please revert this change, and apply zefram's patch.
> > Ah, zefram's patch is already applied. So the only thing left is to > revert the change in 10connect.t, e.g. using > https://cpan.metacpan.org/authors/id/S/SR/SREZIC/patches/DBD-mysql- > 4.028-RT31823.patch
The 10connect.t problem still exists in 4.029.


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.