Skip to content

Commit

Permalink
More tets fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
exodist committed Jul 31, 2024
1 parent c5ce360 commit adada21
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
3 changes: 3 additions & 0 deletions Changes
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
{{$NEXT}}

- Fix some test issues
- Include some needed modules when loading schema

2.000000 2024-07-30 15:00:13-07:00 America/Los_Angeles (TRIAL RELEASE)

- NOTE: Backwords incompatible changes, plugins and renderers may need rewriting
Expand Down
7 changes: 4 additions & 3 deletions t/0-load_all.t
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,16 @@ sub wanted {
my @warnings;

if ($file =~ m{(MySQL|PostgreSQL|SQLite)}) {
ok(eval { require "App/Yath/Schema/$1.pm" }, "Load necessary schema '$1'", $@);
my $schema = $1;
eval { require "App/Yath/Schema/$schema.pm"; 1} or skip_all "Could not load $schema: $@";
}
elsif ($file =~ m{App/Yath/Schema\.pm$} || $file =~ m{Schema/(Overlay|Result)}) {
ok(eval { require App::Yath::Schema::PostgreSQL }, "Load schema");
eval { require App::Yath::Schema::SQLite; 1 } or skip_all "Could not load SQLite: $@";
}

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/) {
if ($err =~ m/^Can't locate / || $err =~ m/version \S+ required--this is only version/ || $err =~ m/must be installed/) {
skip_all $err;
return;
}
Expand Down
2 changes: 2 additions & 0 deletions t/UI/MySQL.t
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
use Test2::Require::Module 'DBD::mysql';
use Test2::Require::Module 'DateTime::Format::MySQL';
use Test2::V0 -target => 'App::Yath::Schema::MySQL';

use ok $CLASS;
Expand Down
2 changes: 2 additions & 0 deletions t/UI/PostgreSQL.t
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
use Test2::Require::Module 'DBD::Pg';
use Test2::Require::Module 'DateTime::Format::Pg';
use Test2::V0 -target => 'App::Yath::Schema::PostgreSQL';

use ok $CLASS;
Expand Down

0 comments on commit adada21

Please sign in to comment.