From: Peter Rabbitson Date: Mon, 23 May 2016 09:08:17 +0000 (+0200) Subject: Some test suite corrections ahead of next commits X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=dbsrgits%2FDBIx-Class.git;a=commitdiff_plain;h=4c90556806f286093d0806e858abdba329e6dfd3 Some test suite corrections ahead of next commits Splitting this off for easier reading --- diff --git a/t/35exception_inaction.t b/t/35exception_inaction.t index 6c032d6..a75ee61 100644 --- a/t/35exception_inaction.t +++ b/t/35exception_inaction.t @@ -39,7 +39,6 @@ sub ok { return !!$_[0]; } - # this is incredibly horrible... # demonstrate utter breakage of the reconnection/retry logic # diff --git a/t/72pg.t b/t/72pg.t index 6c2545f..9d37930 100644 --- a/t/72pg.t +++ b/t/72pg.t @@ -79,8 +79,13 @@ for my $use_insert_returning ($test_server_supports_insert_returning : (0) ) { - no warnings qw/once redefine/; + # doing it here instead of the actual class to keep the main thing under dfs + # and thus keep catching false positives (so far none, but one never knows) + mro::set_mro("DBICTest::Schema", "c3"); + my $old_connection = DBICTest::Schema->can('connection'); + + no warnings qw/once redefine/; local *DBICTest::Schema::connection = set_subname 'DBICTest::Schema::connection' => sub { my $s = shift->$old_connection(@_); $s->storage->_use_insert_returning ($use_insert_returning); diff --git a/t/73oracle.t b/t/73oracle.t index b61a6a8..e7096ea 100644 --- a/t/73oracle.t +++ b/t/73oracle.t @@ -109,8 +109,13 @@ my $schema; for my $use_insert_returning ($test_server_supports_insert_returning ? (1,0) : (0) ) { for my $force_ora_joins ($test_server_supports_only_orajoins ? (0) : (0,1) ) { - no warnings qw/once redefine/; + # doing it here instead of the actual class to keep the main thing under dfs + # and thus keep catching false positives (so far none, but one never knows) + mro::set_mro("DBICTest::Schema", "c3"); + my $old_connection = DBICTest::Schema->can('connection'); + + no warnings qw/once redefine/; local *DBICTest::Schema::connection = set_subname 'DBICTest::Schema::connection' => sub { my $s = shift->$old_connection (@_); $s->storage->_use_insert_returning ($use_insert_returning); diff --git a/t/99dbic_sqlt_parser.t b/t/99dbic_sqlt_parser.t index 51e2521..2ab43a3 100644 --- a/t/99dbic_sqlt_parser.t +++ b/t/99dbic_sqlt_parser.t @@ -196,7 +196,7 @@ lives_ok (sub { { package DBICTest::PartialSchema; - use base qw/DBIx::Class::Schema/; + use base qw/DBICTest::BaseSchema/; __PACKAGE__->load_classes( { 'DBICTest::Schema' => [qw/ diff --git a/t/lib/DBICTest/Schema/Year2000CDs.pm b/t/lib/DBICTest/Schema/Year2000CDs.pm index 6ee67d5..1cf1b37 100644 --- a/t/lib/DBICTest/Schema/Year2000CDs.pm +++ b/t/lib/DBICTest/Schema/Year2000CDs.pm @@ -6,6 +6,11 @@ use strict; use base qw/DBICTest::Schema::CD/; +# FIXME not entirely sure *why* this particular bit trips up tests +# and even more mysteriously: only a single oracle test... +# Running out of time and no local Oracle so can't investigate :/ +use mro 'c3'; + __PACKAGE__->table_class('DBIx::Class::ResultSource::View'); __PACKAGE__->table('year2000cds'); diff --git a/t/lib/testinclude/DBICTestAdminInc.pm b/t/lib/testinclude/DBICTestAdminInc.pm index 212d33d..710dab0 100644 --- a/t/lib/testinclude/DBICTestAdminInc.pm +++ b/t/lib/testinclude/DBICTestAdminInc.pm @@ -5,6 +5,6 @@ use strict; use base 'DBICTest::BaseSchema'; -sub connect { exit 70 } # this is what the test will expect to see +sub connection { exit 70 } # this is what the test will expect to see 1; diff --git a/t/lib/testinclude/DBICTestConfig.pm b/t/lib/testinclude/DBICTestConfig.pm index e531dc4..e59982f 100644 --- a/t/lib/testinclude/DBICTestConfig.pm +++ b/t/lib/testinclude/DBICTestConfig.pm @@ -5,7 +5,7 @@ use strict; use base 'DBICTest::BaseSchema'; -sub connect { +sub connection { my($self, @opt) = @_; @opt == 4 and $opt[0] eq 'klaatu'