Skip to content

Commit

Permalink
(travis) Add SQL::Abstract-NG-based smoking to roster
Browse files Browse the repository at this point in the history
  • Loading branch information
ribasushi committed Oct 30, 2019
1 parent 60a67bc commit c11281c
Show file tree
Hide file tree
Showing 8 changed files with 91 additions and 19 deletions.
15 changes: 14 additions & 1 deletion .travis.yml
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
21 changes: 10 additions & 11 deletions maint/travis-ci_scripts/30_before_script.bash
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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)
Expand Down
8 changes: 7 additions & 1 deletion t/52leaks.t
Expand Up @@ -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 {
Expand Down
6 changes: 5 additions & 1 deletion t/53lean_startup.t
Expand Up @@ -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;
Expand Down
48 changes: 45 additions & 3 deletions t/lib/DBICTest/BaseSchema.pm
Expand Up @@ -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.
Expand Down Expand Up @@ -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;
Expand Down
3 changes: 3 additions & 0 deletions 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);
Expand Down
7 changes: 5 additions & 2 deletions t/storage/base.t
Expand Up @@ -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 || '';

Expand Down
2 changes: 2 additions & 0 deletions t/storage/exception.t
Expand Up @@ -17,6 +17,8 @@ use DBICTest::Schema;

use base 'DBIx::Class::Storage::DBI';

__PACKAGE__->sql_limit_dialect ('LimitOffset');

sub _populate_dbh {
my $self = shift;

Expand Down

0 comments on commit c11281c

Please sign in to comment.