Skip to content

Commit

Permalink
Fix some test issues
Browse files Browse the repository at this point in the history
  • Loading branch information
exodist committed Jul 30, 2024
1 parent 8e3e162 commit c5ce360
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/App/Yath/Server.pm
Original file line number Diff line number Diff line change
Expand Up @@ -129,11 +129,11 @@ sub start_ephemeral_db {

my $db = DBIx::QuickDB->build_db(harness_ui => $qdb_args);
unless($schema_type) {
if (ref($db) =~ m/::(PostgreSQL|MySQL)$/) {
if (ref($db) =~ m/::(PostgreSQL|MariaDB|Percona|SQLite|MySQL)$/) {
$schema_type = $1;
}
else {
die "$db does not look like PostgreSQL or MySQL";
die "$db does not look like PostgreSQL, Percona, MariaDB, SQLite or MySQL";
}
}

Expand Down
5 changes: 5 additions & 0 deletions t/0-load_all.t
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ sub wanted {

my $ok = eval { local $SIG{__WARN__} = sub { push @warnings => @_ }; require($file); 1 };
my $err = $@;
if ($err =~ m/^Can't locate / || $err =~ m/version \S+ required--this is only version/) {
skip_all $err;
return;
}

{
no warnings 'once';
ok($ok, "require $file (" . ($App::Yath::Schema::LOADED // 'undef') . ")", $ok ? () : $err);
Expand Down
3 changes: 3 additions & 0 deletions t/integration/coverage-ui.t
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
use Test2::Plugin::IsolateTemp;
use Test2::V0;

use Test2::Tools::QuickDB;

use Test2::Harness::Util::JSON qw/encode_json decode_json/;
use Test2::Require::Module 'Test2::Plugin::Cover' => '0.000022';

Expand All @@ -17,6 +19,7 @@ $dir =~ s{^\./}{};
$dir =~ s/\d+$//;
$dir =~ s{-ui}{}g;

skipall_unless_can_db();
my $config = App::Yath::Schema::Config->new(ephemeral => 'Auto');
my $server = App::Yath::Server->new(schema_config => $config);
my $db = $server->start_ephemeral_db;
Expand Down
1 change: 1 addition & 0 deletions t/unit/Test2/Harness/Reloader/Inotify2.t
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use Test2::Require::Module 'Linux::Inotify2';
use Test2::V0 -target => 'Test2::Harness::Reloader::Inotify2';

skip_all "write me";
Expand Down

0 comments on commit c5ce360

Please sign in to comment.