Skip to content

Commit c11281c

Browse files
committed
(travis) Add SQL::Abstract-NG-based smoking to roster
1 parent 60a67bc commit c11281c

File tree

8 files changed

+91
-19
lines changed

8 files changed

+91
-19
lines changed

.travis.yml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,17 @@ matrix:
212212
###
213213
# Start of the allow_failures block
214214

215+
# Latest poisoned saneperl with blead CPAN and SQLA swapout, single thread
216+
- perl: "5.24.3"
217+
sudo: required
218+
env:
219+
- DBICTEST_SWAPOUT_SQLAC_WITH=SQL::Abstract
220+
- VCPU_USE=1
221+
- CLEANTEST=false
222+
- DEVREL_DEPS=true
223+
- POISON_ENV=true
224+
- MVDT=false
225+
215226
# ASan-instrumented threaded latest 5.24 with blead CPAN, no tests on depchain ( run only DBICs tests )
216227
- perl: "livebrew_devcpan_5.24.3_thr_asan"
217228
sudo: required
@@ -273,11 +284,12 @@ matrix:
273284
- gcc-8
274285
- g++-8
275286

276-
# bleadperl with blead CPAN, single thread
287+
# bleadperl with blead CPAN and SQLA swapout, single thread
277288
- perl: "livebrew_devcpan_bleadperl_thr_mb"
278289
sudo: required
279290
dist: trusty
280291
env:
292+
- DBICTEST_SWAPOUT_SQLAC_WITH=SQL::Abstract
281293
- VCPU_USE=1
282294
- CLEANTEST=false
283295
- DEVREL_DEPS=true
@@ -374,6 +386,7 @@ matrix:
374386
allow_failures:
375387

376388
# these run with various dev snapshots - allowed to fail
389+
- perl: 5.24.3
377390
- perl: livebrew_devcpan_5.24.3_thr_asan
378391
- perl: livebrew_devcpan_bleadperl_thr_mb_asan
379392
- perl: livebrew_devcpan_bleadperl_thr_mb

maint/travis-ci_scripts/30_before_script.bash

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ if [[ -n "$SHORT_CIRCUIT_SMOKE" ]] ; then exit 0 ; fi
1212

1313
if [[ "$DEVREL_DEPS" == "true" ]] ; then
1414
PINS_REQUIRED+=( 'Data::Page~<2.04' )
15+
16+
# FIXME work around https://github.com/dbsrgits/sql-abstract/pull/16
17+
if ! perl -M5.010 -e1 &>/dev/null ; then
18+
PINS_REQUIRED+=( "I/IL/ILMARI/SQL-Abstract-1.86.tar.gz" )
19+
fi
1520
fi
1621

1722
# FIXME freeze Clone until H::M is erradicated
@@ -53,12 +58,6 @@ if [[ "$MVDT" == "true" ]] ; then
5358

5459
parallel_installdeps_notest DBD::[email protected]
5560

56-
# FIXME work around DBD::DB2 being silly: https://rt.cpan.org/Ticket/Display.html?id=101659
57-
if [[ -n "$DBICTEST_DB2_DSN" ]] ; then
58-
echo_err "Installing same DBI version into the main perl (above the current local::lib)"
59-
$SHELL -lic "perlbrew use $( perlbrew use | grep -oP '(?<=Currently using )[^@]+' ) && parallel_installdeps_notest T/TI/TIMB/DBI-1.614.tar.gz"
60-
fi
61-
6261
# We need to stick with older DBD::Oracle, otherwise it will bump the DBI version up
6362
if [[ -n "$DBICTEST_ORA_DSN" ]] ; then
6463
parallel_installdeps_notest DBD::[email protected]
@@ -69,11 +68,6 @@ if [[ "$MVDT" == "true" ]] ; then
6968

7069
parallel_installdeps_notest DBD::[email protected]
7170

72-
# FIXME work around DBD::DB2 being silly: https://rt.cpan.org/Ticket/Display.html?id=101659
73-
if [[ -n "$DBICTEST_DB2_DSN" ]] ; then
74-
echo_err "Installing same DBI version into the main perl (above the current local::lib)"
75-
$SHELL -lic "perlbrew use $( perlbrew use | grep -oP '(?<=Currently using )[^@]+' ) && parallel_installdeps_notest T/TI/TIMB/DBI-1.57.tar.gz"
76-
fi
7771
fi
7872

7973
# Test both minimum DBD::SQLite and minimum BigInt SQLite
@@ -184,6 +178,11 @@ else
184178
parallel_installdeps_notest git://github.com/ribasushi/patchup-Perl5-DBD-InterBase.git
185179
fi
186180

181+
# FIXME work around DBD::DB2 being silly: https://rt.cpan.org/Ticket/Display.html?id=101659
182+
if [[ -n "$DBICTEST_DB2_DSN" ]] ; then
183+
parallel_installdeps_notest git://github.com/ribasushi/patchup-Perl5-DBD-DB2.git
184+
fi
185+
187186
# SCGI does not install under ASan nor < 5.8.8 perls nor under parallel make
188187
# FIXME: The 5.8.8 thing is likely fixable, something to do with
189188
# #define speedy_new(s,n,t) Newx(s,n,t)

t/52leaks.t

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,13 @@ unless (DBICTest::RunMode->is_plain) {
304304
# Only do this when we do have the bits to look inside CVs properly,
305305
# without it we are liable to pick up object defaults that are locked
306306
# in method closures
307-
if (DBICTest::Util::LeakTracer::CV_TRACING) {
307+
#
308+
# Some elaborate SQLAC-replacements leak, do not worry about it for now
309+
if (
310+
DBICTest::Util::LeakTracer::CV_TRACING
311+
and
312+
! $ENV{DBICTEST_SWAPOUT_SQLAC_WITH}
313+
) {
308314
visit_refs(
309315
refs => [ $base_collection ],
310316
action => sub {

t/53lean_startup.t

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,11 @@
44
my ($initial_inc_contents, $expected_dbic_deps, $require_sites);
55
BEGIN {
66
# these envvars *will* bring in more stuff than the baseline
7-
delete @ENV{qw(DBICTEST_SQLT_DEPLOY DBIC_TRACE)};
7+
delete @ENV{qw(
8+
DBICTEST_SWAPOUT_SQLAC_WITH
9+
DBICTEST_SQLT_DEPLOY
10+
DBIC_TRACE
11+
)};
812

913
# make sure extras do not load even when this is set
1014
$ENV{PERL_STRICTURES_EXTRA} = 1;

t/lib/DBICTest/BaseSchema.pm

Lines changed: 45 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,49 @@ END {
116116
my $weak_registry = {};
117117

118118
sub connection {
119-
my $self = shift->next::method(@_);
119+
my( $proto, @args ) = @_;
120+
121+
if( $ENV{DBICTEST_SWAPOUT_SQLAC_WITH} ) {
122+
123+
my( $sqlac_like ) = $ENV{DBICTEST_SWAPOUT_SQLAC_WITH} =~ /(.+)/;
124+
Class::C3::Componentised->ensure_class_loaded( $sqlac_like );
125+
126+
require DBIx::Class::SQLMaker::ClassicExtensions;
127+
require SQL::Abstract::Classic;
128+
129+
Class::C3::Componentised->inject_base(
130+
'DBICTest::SQLAC::SwapOut',
131+
'DBIx::Class::SQLMaker::ClassicExtensions',
132+
$sqlac_like,
133+
'SQL::Abstract::Classic',
134+
);
135+
136+
# perl can be pretty disgusting...
137+
push @args, {}
138+
unless ref( $args[-1] ) eq 'HASH';
139+
140+
$args[-1] = { %{ $args[-1] } };
141+
142+
if( ref( $args[-1]{on_connect_call} ) ne 'ARRAY' ) {
143+
$args[-1]{on_connect_call} = [
144+
$args[-1]{on_connect_call}
145+
? [ $args[-1]{on_connect_call} ]
146+
: ()
147+
];
148+
}
149+
elsif( ref( $args[-1]{on_connect_call}[0] ) ne 'ARRAY' ) {
150+
$args[-1]{on_connect_call} = [ map
151+
{ [ $_ ] }
152+
@{ $args[-1]{on_connect_call} }
153+
];
154+
}
155+
156+
push @{ $args[-1]{on_connect_call} }, (
157+
[ rebase_sqlmaker => 'DBICTest::SQLAC::SwapOut' ],
158+
);
159+
}
160+
161+
my $self = $proto->next::method( @args );
120162

121163
# MASSIVE FIXME
122164
# 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 {
145187
and
146188
( ! $ENV{DBICTEST_LOCK_HOLDER} or $ENV{DBICTEST_LOCK_HOLDER} == $$ )
147189
and
148-
ref($_[0]) ne 'CODE'
190+
ref($args[0]) ne 'CODE'
149191
and
150-
($_[0]||'') !~ /^ (?i:dbi) \: SQLite (?: \: | \W ) .*? (?: dbname\= )? (?: \:memory\: | t [\/\\] var [\/\\] DBIxClass\-) /x
192+
($args[0]||'') !~ /^ (?i:dbi) \: SQLite (?: \: | \W ) .*? (?: dbname\= )? (?: \:memory\: | t [\/\\] var [\/\\] DBIxClass\-) /x
151193
) {
152194

153195
my $locktype;

t/sqlmaker/rebase.t

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
use strict;
22
use warnings;
33

4+
# test relies on the original default
5+
BEGIN { delete @ENV{qw( DBICTEST_SWAPOUT_SQLAC_WITH )} }
6+
47
use Test::More;
58

69
use lib qw(t/lib);

t/storage/base.t

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,8 +177,11 @@ for my $type (keys %$invocations) {
177177
# make sure connection-less storages do not throw on _determine_driver
178178
# but work with ENV at the same time
179179
SKIP: for my $env_dsn (undef, (DBICTest->_database)[0] ) {
180-
skip 'Subtest relies on being connected to SQLite', 1
181-
if $env_dsn and $env_dsn !~ /\:SQLite\:/;
180+
skip( 'Subtest relies on being connected to SQLite without overrides', 1 ) if (
181+
$ENV{DBICTEST_SWAPOUT_SQLAC_WITH}
182+
or
183+
( $env_dsn and $env_dsn !~ /\:SQLite\:/ )
184+
);
182185

183186
local $ENV{DBI_DSN} = $env_dsn || '';
184187

t/storage/exception.t

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ use DBICTest::Schema;
1717

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

20+
__PACKAGE__->sql_limit_dialect ('LimitOffset');
21+
2022
sub _populate_dbh {
2123
my $self = shift;
2224

0 commit comments

Comments
 (0)