diff --git a/.travis.yml b/.travis.yml index 2c92375d3..704117e60 100644 --- a/.travis.yml +++ b/.travis.yml @@ -212,6 +212,17 @@ matrix: ### # Start of the allow_failures block + # Latest poisoned saneperl with blead CPAN and SQLA swapout, single thread + - perl: "5.24.3" + sudo: required + env: + - DBICTEST_SWAPOUT_SQLAC_WITH=SQL::Abstract + - VCPU_USE=1 + - CLEANTEST=false + - DEVREL_DEPS=true + - POISON_ENV=true + - MVDT=false + # ASan-instrumented threaded latest 5.24 with blead CPAN, no tests on depchain ( run only DBICs tests ) - perl: "livebrew_devcpan_5.24.3_thr_asan" sudo: required @@ -273,11 +284,12 @@ matrix: - gcc-8 - g++-8 - # bleadperl with blead CPAN, single thread + # bleadperl with blead CPAN and SQLA swapout, single thread - perl: "livebrew_devcpan_bleadperl_thr_mb" sudo: required dist: trusty env: + - DBICTEST_SWAPOUT_SQLAC_WITH=SQL::Abstract - VCPU_USE=1 - CLEANTEST=false - DEVREL_DEPS=true @@ -374,6 +386,7 @@ matrix: allow_failures: # these run with various dev snapshots - allowed to fail + - perl: 5.24.3 - perl: livebrew_devcpan_5.24.3_thr_asan - perl: livebrew_devcpan_bleadperl_thr_mb_asan - perl: livebrew_devcpan_bleadperl_thr_mb diff --git a/maint/travis-ci_scripts/30_before_script.bash b/maint/travis-ci_scripts/30_before_script.bash index c8c105c32..100f36d1b 100755 --- a/maint/travis-ci_scripts/30_before_script.bash +++ b/maint/travis-ci_scripts/30_before_script.bash @@ -12,6 +12,11 @@ if [[ -n "$SHORT_CIRCUIT_SMOKE" ]] ; then exit 0 ; fi if [[ "$DEVREL_DEPS" == "true" ]] ; then PINS_REQUIRED+=( 'Data::Page~<2.04' ) + + # FIXME work around https://github.com/dbsrgits/sql-abstract/pull/16 + if ! perl -M5.010 -e1 &>/dev/null ; then + PINS_REQUIRED+=( "I/IL/ILMARI/SQL-Abstract-1.86.tar.gz" ) + fi fi # FIXME freeze Clone until H::M is erradicated @@ -53,12 +58,6 @@ if [[ "$MVDT" == "true" ]] ; then parallel_installdeps_notest DBD::Pg@2.17.2 - # FIXME work around DBD::DB2 being silly: https://rt.cpan.org/Ticket/Display.html?id=101659 - if [[ -n "$DBICTEST_DB2_DSN" ]] ; then - echo_err "Installing same DBI version into the main perl (above the current local::lib)" - $SHELL -lic "perlbrew use $( perlbrew use | grep -oP '(?<=Currently using )[^@]+' ) && parallel_installdeps_notest T/TI/TIMB/DBI-1.614.tar.gz" - fi - # We need to stick with older DBD::Oracle, otherwise it will bump the DBI version up if [[ -n "$DBICTEST_ORA_DSN" ]] ; then parallel_installdeps_notest DBD::Oracle@1.74 @@ -69,11 +68,6 @@ if [[ "$MVDT" == "true" ]] ; then parallel_installdeps_notest DBD::Pg@2.9.2 - # FIXME work around DBD::DB2 being silly: https://rt.cpan.org/Ticket/Display.html?id=101659 - if [[ -n "$DBICTEST_DB2_DSN" ]] ; then - echo_err "Installing same DBI version into the main perl (above the current local::lib)" - $SHELL -lic "perlbrew use $( perlbrew use | grep -oP '(?<=Currently using )[^@]+' ) && parallel_installdeps_notest T/TI/TIMB/DBI-1.57.tar.gz" - fi fi # Test both minimum DBD::SQLite and minimum BigInt SQLite @@ -184,6 +178,11 @@ else parallel_installdeps_notest git://github.com/ribasushi/patchup-Perl5-DBD-InterBase.git fi + # FIXME work around DBD::DB2 being silly: https://rt.cpan.org/Ticket/Display.html?id=101659 + if [[ -n "$DBICTEST_DB2_DSN" ]] ; then + parallel_installdeps_notest git://github.com/ribasushi/patchup-Perl5-DBD-DB2.git + fi + # SCGI does not install under ASan nor < 5.8.8 perls nor under parallel make # FIXME: The 5.8.8 thing is likely fixable, something to do with # #define speedy_new(s,n,t) Newx(s,n,t) diff --git a/t/52leaks.t b/t/52leaks.t index 3e042eee4..843e6f5c0 100644 --- a/t/52leaks.t +++ b/t/52leaks.t @@ -304,7 +304,13 @@ unless (DBICTest::RunMode->is_plain) { # Only do this when we do have the bits to look inside CVs properly, # without it we are liable to pick up object defaults that are locked # in method closures - if (DBICTest::Util::LeakTracer::CV_TRACING) { + # + # Some elaborate SQLAC-replacements leak, do not worry about it for now + if ( + DBICTest::Util::LeakTracer::CV_TRACING + and + ! $ENV{DBICTEST_SWAPOUT_SQLAC_WITH} + ) { visit_refs( refs => [ $base_collection ], action => sub { diff --git a/t/53lean_startup.t b/t/53lean_startup.t index 303b2955e..9a4ef8583 100644 --- a/t/53lean_startup.t +++ b/t/53lean_startup.t @@ -4,7 +4,11 @@ my ($initial_inc_contents, $expected_dbic_deps, $require_sites); BEGIN { # these envvars *will* bring in more stuff than the baseline - delete @ENV{qw(DBICTEST_SQLT_DEPLOY DBIC_TRACE)}; + delete @ENV{qw( + DBICTEST_SWAPOUT_SQLAC_WITH + DBICTEST_SQLT_DEPLOY + DBIC_TRACE + )}; # make sure extras do not load even when this is set $ENV{PERL_STRICTURES_EXTRA} = 1; diff --git a/t/lib/DBICTest/BaseSchema.pm b/t/lib/DBICTest/BaseSchema.pm index e550ec9cc..bb5146f58 100644 --- a/t/lib/DBICTest/BaseSchema.pm +++ b/t/lib/DBICTest/BaseSchema.pm @@ -116,7 +116,49 @@ END { my $weak_registry = {}; sub connection { - my $self = shift->next::method(@_); + my( $proto, @args ) = @_; + + if( $ENV{DBICTEST_SWAPOUT_SQLAC_WITH} ) { + + my( $sqlac_like ) = $ENV{DBICTEST_SWAPOUT_SQLAC_WITH} =~ /(.+)/; + Class::C3::Componentised->ensure_class_loaded( $sqlac_like ); + + require DBIx::Class::SQLMaker::ClassicExtensions; + require SQL::Abstract::Classic; + + Class::C3::Componentised->inject_base( + 'DBICTest::SQLAC::SwapOut', + 'DBIx::Class::SQLMaker::ClassicExtensions', + $sqlac_like, + 'SQL::Abstract::Classic', + ); + + # perl can be pretty disgusting... + push @args, {} + unless ref( $args[-1] ) eq 'HASH'; + + $args[-1] = { %{ $args[-1] } }; + + if( ref( $args[-1]{on_connect_call} ) ne 'ARRAY' ) { + $args[-1]{on_connect_call} = [ + $args[-1]{on_connect_call} + ? [ $args[-1]{on_connect_call} ] + : () + ]; + } + elsif( ref( $args[-1]{on_connect_call}[0] ) ne 'ARRAY' ) { + $args[-1]{on_connect_call} = [ map + { [ $_ ] } + @{ $args[-1]{on_connect_call} } + ]; + } + + push @{ $args[-1]{on_connect_call} }, ( + [ rebase_sqlmaker => 'DBICTest::SQLAC::SwapOut' ], + ); + } + + my $self = $proto->next::method( @args ); # MASSIVE FIXME # we can't really lock based on DSN, as we do not yet have a way to tell that e.g. @@ -145,9 +187,9 @@ sub connection { and ( ! $ENV{DBICTEST_LOCK_HOLDER} or $ENV{DBICTEST_LOCK_HOLDER} == $$ ) and - ref($_[0]) ne 'CODE' + ref($args[0]) ne 'CODE' and - ($_[0]||'') !~ /^ (?i:dbi) \: SQLite (?: \: | \W ) .*? (?: dbname\= )? (?: \:memory\: | t [\/\\] var [\/\\] DBIxClass\-) /x + ($args[0]||'') !~ /^ (?i:dbi) \: SQLite (?: \: | \W ) .*? (?: dbname\= )? (?: \:memory\: | t [\/\\] var [\/\\] DBIxClass\-) /x ) { my $locktype; diff --git a/t/sqlmaker/rebase.t b/t/sqlmaker/rebase.t index 9fca65766..053c1ebe2 100644 --- a/t/sqlmaker/rebase.t +++ b/t/sqlmaker/rebase.t @@ -1,6 +1,9 @@ use strict; use warnings; +# test relies on the original default +BEGIN { delete @ENV{qw( DBICTEST_SWAPOUT_SQLAC_WITH )} } + use Test::More; use lib qw(t/lib); diff --git a/t/storage/base.t b/t/storage/base.t index 9a79e1f37..debc653b9 100644 --- a/t/storage/base.t +++ b/t/storage/base.t @@ -177,8 +177,11 @@ for my $type (keys %$invocations) { # make sure connection-less storages do not throw on _determine_driver # but work with ENV at the same time SKIP: for my $env_dsn (undef, (DBICTest->_database)[0] ) { - skip 'Subtest relies on being connected to SQLite', 1 - if $env_dsn and $env_dsn !~ /\:SQLite\:/; + skip( 'Subtest relies on being connected to SQLite without overrides', 1 ) if ( + $ENV{DBICTEST_SWAPOUT_SQLAC_WITH} + or + ( $env_dsn and $env_dsn !~ /\:SQLite\:/ ) + ); local $ENV{DBI_DSN} = $env_dsn || ''; diff --git a/t/storage/exception.t b/t/storage/exception.t index d96e336cf..d266dd8bd 100644 --- a/t/storage/exception.t +++ b/t/storage/exception.t @@ -17,6 +17,8 @@ use DBICTest::Schema; use base 'DBIx::Class::Storage::DBI'; + __PACKAGE__->sql_limit_dialect ('LimitOffset'); + sub _populate_dbh { my $self = shift;