use Test::Exception;
use DBIx::Class::Optional::Dependencies ();
use Scope::Guard ();
+use List::Util 'shuffle';
use Try::Tiny;
use lib qw(t/lib);
use DBICTest;
my $schema;
-for my $prefix (keys %$env2optdep) { SKIP: {
+for my $prefix (shuffle keys %$env2optdep) { SKIP: {
- my ($dsn, $user, $pass) = map { $ENV{"${prefix}_$_"} } qw/DSN USER PASS/;
+ skip ("Testing with ${prefix}_DSN needs " . DBIx::Class::Optional::Dependencies->req_missing_for( $env2optdep->{$prefix} ), 1)
+ unless DBIx::Class::Optional::Dependencies->req_ok_for($env2optdep->{$prefix});
- next unless $dsn;
+ my ($dsn, $user, $pass) = map { $ENV{"${prefix}_$_"} } qw/DSN USER PASS/;
note "Testing with ${prefix}_DSN";
- skip ("Testing with ${prefix}_DSN needs " . DBIx::Class::Optional::Dependencies->req_missing_for( $env2optdep->{$prefix} ), 1)
- unless DBIx::Class::Optional::Dependencies->req_ok_for($env2optdep->{$prefix});
-
- $schema = DBICTest->connect_schema($dsn, $user, $pass, {
+ $schema = DBICTest::Schema->connect($dsn, $user, $pass, {
auto_savepoint => 1,
quote_names => 1,
($dsn !~ /ODBC/ ? (on_connect_call => 'use_softcommit') : ()),