From: Dagfinn Ilmari Mannsåker Date: Mon, 28 Jul 2014 23:17:42 +0000 (+0100) Subject: Run multi-DSN tests in a deterministic order X-Git-Tag: 0.07041~19 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=dbsrgits%2FDBIx-Class-Schema-Loader.git;a=commitdiff_plain;h=7336f5dc45f7b330b6ea21b31edb3591de0b2d40 Run multi-DSN tests in a deterministic order --- diff --git a/t/10_07mssql_common.t b/t/10_07mssql_common.t index b7eeb80..185405c 100644 --- a/t/10_07mssql_common.t +++ b/t/10_07mssql_common.t @@ -27,7 +27,7 @@ use constant EXTRA_DUMP_DIR => "$tdir/mssql_extra_dump"; # for extra tests cleanup my $schema; -my ($dsns, $common_version); +my (%dsns, $common_version); for (qw/MSSQL MSSQL_ODBC MSSQL_ADO/) { next unless $ENV{"DBICTEST_${_}_DSN"}; @@ -39,12 +39,12 @@ for (qw/MSSQL MSSQL_ODBC MSSQL_ADO/) { next; } - $dsns->{$_}{dsn} = $ENV{"DBICTEST_${_}_DSN"}; - $dsns->{$_}{user} = $ENV{"DBICTEST_${_}_USER"}; - $dsns->{$_}{password} = $ENV{"DBICTEST_${_}_PASS"}; + $dsns{$_}{dsn} = $ENV{"DBICTEST_${_}_DSN"}; + $dsns{$_}{user} = $ENV{"DBICTEST_${_}_USER"}; + $dsns{$_}{password} = $ENV{"DBICTEST_${_}_PASS"}; require DBI; - my $dbh = DBI->connect (@{$dsns->{$_}}{qw/dsn user password/}, { RaiseError => 1, PrintError => 0} ); + my $dbh = DBI->connect (@{$dsns{$_}}{qw/dsn user password/}, { RaiseError => 1, PrintError => 0} ); my $srv_ver = eval { $dbh->get_info(18) || @@ -59,7 +59,7 @@ for (qw/MSSQL MSSQL_ODBC MSSQL_ADO/) { } plan skip_all => 'You need to set the DBICTEST_MSSQL_DSN, _USER and _PASS and/or the DBICTEST_MSSQL_ODBC_DSN, _USER and _PASS environment variables' - unless $dsns; + unless %dsns; my $mssql_2008_new_data_types = { date => { data_type => 'date' }, @@ -98,7 +98,7 @@ my $tester = dbixcsl_common_tests->new( vendor => 'mssql', auto_inc_pk => 'INTEGER IDENTITY NOT NULL PRIMARY KEY', default_function_def => 'DATETIME DEFAULT getdate()', - connect_info => [values %$dsns], + connect_info => [ map { $dsns{$_} } sort keys %dsns ], preserve_case_mode_is_exclusive => 1, quote_char => [ qw/[ ]/ ], basic_date_datatype => ($common_version >= 10) ? 'DATE' : 'SMALLDATETIME', diff --git a/t/10_08sqlanywhere_common.t b/t/10_08sqlanywhere_common.t index 6fff6d0..6f1f58e 100644 --- a/t/10_08sqlanywhere_common.t +++ b/t/10_08sqlanywhere_common.t @@ -44,7 +44,7 @@ my ($schema, $schemas_created); # for cleanup in END for extra tests my $tester = dbixcsl_common_tests->new( vendor => 'SQLAnywhere', auto_inc_pk => 'INTEGER IDENTITY NOT NULL PRIMARY KEY', - connect_info => [ values %dsns ], + connect_info => [ map { $dsns{$_} } sort keys %dsns ], loader_options => { preserve_case => 1 }, default_is_deferrable => 1, default_on_clause => 'RESTRICT', diff --git a/t/10_09firebird_common.t b/t/10_09firebird_common.t index 23c71e8..1a044d1 100644 --- a/t/10_09firebird_common.t +++ b/t/10_09firebird_common.t @@ -58,7 +58,7 @@ my $tester = dbixcsl_common_tests->new( null => '', preserve_case_mode_is_exclusive => 1, quote_char => '"', - connect_info => [ values %dsns ], + connect_info => [ map { $dsns{$_} } sort keys %dsns ], data_types => { # based on the Interbase Data Definition Guide # http://www.ibphoenix.com/downloads/60DataDef.zip diff --git a/t/10_11msaccess_common.t b/t/10_11msaccess_common.t index c71024b..6736d9d 100644 --- a/t/10_11msaccess_common.t +++ b/t/10_11msaccess_common.t @@ -50,7 +50,7 @@ my $tester = dbixcsl_common_tests->new( vendor => 'Access', auto_inc_pk => 'AUTOINCREMENT PRIMARY KEY', quote_char => [qw/[ ]/], - connect_info => [ values %dsns ], + connect_info => [ map { $dsns{$_} } sort keys %dsns ], data_types => { # http://msdn.microsoft.com/en-us/library/bb208866(v=office.12).aspx #