From d44406ffd35ac82b67b1de5bca75f5cd0e424727 Mon Sep 17 00:00:00 2001 From: "David E. Wheeler" Date: Wed, 15 Jan 2025 12:22:51 -0500 Subject: [PATCH 1/2] Check libintl version before suppressing warnings The warning was fixed in v1.35, so only suppress it ourselves for earlier versions. --- t/lib/TestConfig.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/t/lib/TestConfig.pm b/t/lib/TestConfig.pm index 133dfe83..e3f1a94e 100644 --- a/t/lib/TestConfig.pm +++ b/t/lib/TestConfig.pm @@ -8,7 +8,7 @@ BEGIN { # Suppress warnings from Locale::Messages. # https://github.com/gflohr/libintl-perl/issues/14 use Locale::Messages; - if ($Locale::Messages::package eq 'gettext_pp') { + if ($Locale::Messages::package eq 'gettext_pp' && Locale::Messages->VERSION < 1.35) { no warnings qw(redefine prototype); no strict 'refs'; my $orig = \&Locale::gettext_pp::__locale_category; From 79df6a458d3d533abfa708ca2cc61e204bebb492 Mon Sep 17 00:00:00 2001 From: "David E. Wheeler" Date: Wed, 15 Jan 2025 18:03:30 -0500 Subject: [PATCH 2/2] Fix Exasol and Firebird test errors Plug a few more holes in the expectation that Sqitch always raises App::Sqitch::X objects rather than strings, as discovered by some unanticipated test configurations (resolves #858). Also fix a couple of typos and the default URI for Exasol tests. --- Changes | 2 ++ t/exasol.t | 2 +- t/firebird.t | 8 +++++--- t/lib/DBIEngineTest.pm | 2 +- t/snowflake.t | 2 +- 5 files changed, 10 insertions(+), 6 deletions(-) diff --git a/Changes b/Changes index 4c36ca4c..18143f98 100644 --- a/Changes +++ b/Changes @@ -4,6 +4,8 @@ Revision history for Perl extension App::Sqitch - Fixed a bug introduced in v1.5.0 where the MySQL engine connected to the target database instead of the registry database. Thanks to @tiberiusferreira for the report (#862)! + - Fixed test failures with some Exasol and Firebird configurations. + Thanks to Slaven Rezić for the report (#858)! 1.5.0 2025-01-08T03:22:40 - Fix improperly nested Pod headers that were incrementing two levels diff --git a/t/exasol.t b/t/exasol.t index 67129df3..f6734672 100644 --- a/t/exasol.t +++ b/t/exasol.t @@ -414,7 +414,7 @@ END { $uri = URI->new( $ENV{SQITCH_TEST_EXASOL_URI} || $ENV{EXA_URI} || - 'db:dbadmin:password@localhost/dbadmin' + 'db:exasol://dbadmin:password@localhost/dbadmin' ); my $err; for my $i (1..30) { diff --git a/t/firebird.t b/t/firebird.t index d125dd38..d235529a 100644 --- a/t/firebird.t +++ b/t/firebird.t @@ -31,7 +31,7 @@ my $uri; my $tmpdir; my $have_fb_driver = 1; # assume DBD::Firebird is installed and so is Firebird -# Is DBD::Firebird realy installed? +# Is DBD::Firebird really installed? try { require DBD::Firebird; } catch { $have_fb_driver = 0; }; BEGIN { @@ -472,11 +472,13 @@ DBIEngineTest->run( # DBD::Firebird. my $cmd = $self->client; my $cmd_echo = qx(echo "quit;" | "$cmd" -z -quiet 2>&1 ); - return 0 unless $cmd_echo =~ m{Firebird}ims; + App::Sqitch::X::hurl('isql not for Firebird') + unless $cmd_echo =~ m{Firebird}ims; chomp $cmd_echo; say "# Detected $cmd_echo"; # Skip if no DBD::Firebird. - return 0 unless $have_fb_driver; + App::Sqitch::X::hurl('DBD::Firebird did not load') + unless $have_fb_driver; say "# Connected to Firebird $fb_version" if $fb_version; return 1; }, diff --git a/t/lib/DBIEngineTest.pm b/t/lib/DBIEngineTest.pm index 58d30815..75ba8502 100644 --- a/t/lib/DBIEngineTest.pm +++ b/t/lib/DBIEngineTest.pm @@ -88,7 +88,7 @@ sub run { ); if (my $code = $p{skip_unless}) { try { - $code->( $engine ) || die 'NO'; + $code->( $engine ) || App::Sqitch::X::hurl('NO'); } catch { plan skip_all => sprintf( 'Unable to live-test %s engine: %s', diff --git a/t/snowflake.t b/t/snowflake.t index 4dc2a7b9..cf286d6e 100644 --- a/t/snowflake.t +++ b/t/snowflake.t @@ -578,7 +578,7 @@ $uri = URI->new( $ENV{SNOWSQL_URI} || 'db:snowflake://accountname/?Driver=Snowflake' ); -$uri->host($uri->host . ".snowflakecomputing.com") if $uri->host !~ /snoflakecomputing[.]com/; +$uri->host($uri->host . ".snowflakecomputing.com") if $uri->host !~ /snowflakecomputing[.]com/; my $err = try { $snow->use_driver; $dbh = DBI->connect($uri->dbi_dsn, $uri->user, $uri->password, {