From: Peter Rabbitson Date: Mon, 12 Sep 2016 12:12:35 +0000 (+0200) Subject: Fixup several tests silently broken by 12e7015a X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=3aa25d8b47104964c689be4ca8c1fc5b17781a7f;p=dbsrgits%2FDBIx-Class.git Fixup several tests silently broken by 12e7015a A number of tests that we do not run during CI (lack of RDBMS) have run-time tests concerning backcompat along the lines of: $schema->class('Artist')->load_components('PK::Auto...') The above causes the class' mro to be switched after $schema instantiation and subsequently triggers the sanitychecker. Instead of ripping these lines out (without a way to test them) - simply augment the ::Artist based set of classes to preempt the check failures in the first place. --- diff --git a/lib/DBIx/Class/Schema/SanityChecker.pm b/lib/DBIx/Class/Schema/SanityChecker.pm index 61936d9..4cc7958 100644 --- a/lib/DBIx/Class/Schema/SanityChecker.pm +++ b/lib/DBIx/Class/Schema/SanityChecker.pm @@ -505,7 +505,8 @@ sub check_valid_c3_composition { push @err, { class => $class, - isa => $desc->{isa}, + initial_linear_isa => $desc->{linear_isa}, + current_linear_isa => do { (undef, my @isa) = @{ mro::get_linear_isa($class) }; \@isa }, initial_mro => $desc->{mro}{type}, current_mro => mro::get_mro($class), affected_methods => $affected_methods, diff --git a/t/lib/DBICTest/Base.pm b/t/lib/DBICTest/Base.pm index 9024f8e..8610208 100644 --- a/t/lib/DBICTest/Base.pm +++ b/t/lib/DBICTest/Base.pm @@ -6,6 +6,8 @@ use warnings; use DBICTest::Util; +# FIXME - Carp::Skip should somehow allow for augmentation based on +# mro::get_linear_isa or somesuch... sub _skip_namespace_frames { '^DBICTest' } 1; diff --git a/t/lib/DBICTest/Schema/Artist.pm b/t/lib/DBICTest/Schema/Artist.pm index 00c1ef6..808e05a 100644 --- a/t/lib/DBICTest/Schema/Artist.pm +++ b/t/lib/DBICTest/Schema/Artist.pm @@ -5,6 +5,8 @@ use warnings; use strict; use base 'DBICTest::BaseResult'; +use mro 'c3'; + use DBICTest::Util 'check_customcond_args'; __PACKAGE__->table('artist'); diff --git a/t/lib/DBICTest/Schema/ArtistSourceName.pm b/t/lib/DBICTest/Schema/ArtistSourceName.pm index 3e6a7e6..cf1b5de 100644 --- a/t/lib/DBICTest/Schema/ArtistSourceName.pm +++ b/t/lib/DBICTest/Schema/ArtistSourceName.pm @@ -5,6 +5,8 @@ use warnings; use strict; use base 'DBICTest::Schema::Artist'; +use mro 'c3'; + __PACKAGE__->table(__PACKAGE__->table); __PACKAGE__->source_name('SourceNameArtists'); diff --git a/t/lib/DBICTest/Schema/ArtistSubclass.pm b/t/lib/DBICTest/Schema/ArtistSubclass.pm index e1b97fa..31062b5 100644 --- a/t/lib/DBICTest/Schema/ArtistSubclass.pm +++ b/t/lib/DBICTest/Schema/ArtistSubclass.pm @@ -5,6 +5,7 @@ use warnings; use strict; use base 'DBICTest::Schema::Artist'; +use mro 'c3'; __PACKAGE__->table(__PACKAGE__->table); diff --git a/t/lib/DBICTest/Schema/CustomSql.pm b/t/lib/DBICTest/Schema/CustomSql.pm index d22b3fe..d179464 100644 --- a/t/lib/DBICTest/Schema/CustomSql.pm +++ b/t/lib/DBICTest/Schema/CustomSql.pm @@ -5,6 +5,7 @@ use warnings; use strict; use base qw/DBICTest::Schema::Artist/; +use mro 'c3'; __PACKAGE__->table('dummy');