From: Peter Rabbitson Date: Thu, 2 Apr 2015 01:04:24 +0000 (+0200) Subject: (travis) Multiple fixups to the CI lifted from blead: X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=1864ab54ac1abe5f520678b1a6f9b4cc24004d86;p=dbsrgits%2FDBIx-Class.git (travis) Multiple fixups to the CI lifted from blead: - Much lighter CI runs when smoking a PR - Revert backout of ODBC firebird testing aa0e82a2 - Restore and enhance post-success to run a full CPAN install cycle - Cut down the amount of APT repos during updates - *FINALLY* remove Module::Build::Tiny front-loading - Double check M::B::T is not pulled in - Peg Module::Install - new versions deps on autodie, which is 5.8.4+ - Enhance perl sterilization to somewhat work on < 5.12 as well - Correctly detect CI on github forks - Improve the "Did it really install?" check - Better shuffling of the prereq installation order - Fix silencer changes (f8200928) which were practically undone by 8b60b921 --- diff --git a/.travis.yml b/.travis.yml index f036df1..e7d1fa7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,7 +18,7 @@ # possible set of deps *without testing them*. This ensures we stay within # a reasonable build-time and still run as many of our tests as possible # -# * The perl builds and the DBIC tests run under NUMTHREADS number of threads. +# * The perl builds and the DBIC tests run under VCPU_USE number of threads. # The testing of dependencies under CLEANTEST runs single-threaded, at least # until we fix our entire dep-chain to safely pass under -j # @@ -75,7 +75,7 @@ perl: env: - CLEANTEST=false - - CLEANTEST=true NUMTHREADS=1 + - CLEANTEST=true VCPU_USE=1 matrix: fast_finish: true @@ -275,6 +275,11 @@ script: # - maint/getstatus maint/travis-ci_scripts/40_script.bash +### +### Set -e back, work around https://github.com/travis-ci/travis-ci/issues/3533 +### + - set -e + after_success: # Check if we can assemble a dist properly if not in CLEANTEST # diff --git a/lib/DBIx/Class/Optional/Dependencies.pm b/lib/DBIx/Class/Optional/Dependencies.pm index 5544308..cf0cb76 100644 --- a/lib/DBIx/Class/Optional/Dependencies.pm +++ b/lib/DBIx/Class/Optional/Dependencies.pm @@ -672,9 +672,19 @@ my $dbic_reqs = { # we need to run the dbicadmin so we can self-generate its POD # also we do not want surprises in case JSON::XS is in the path # so make sure we get an always-working JSON::Any - include => [qw( admin_script _json_xs_compatible_json_any )], + include => [qw( + admin_script + _json_xs_compatible_json_any + id_shortener + deploy + test_pod + test_podcoverage + test_whitespace + test_strictures + )], req => { 'ExtUtils::MakeMaker' => '6.64', + 'Module::Install' => '1.06', 'Pod::Inherit' => '0.91', }, }, diff --git a/maint/travis-ci_scripts/10_before_install.bash b/maint/travis-ci_scripts/10_before_install.bash index 356c17c..7f6c5c3 100755 --- a/maint/travis-ci_scripts/10_before_install.bash +++ b/maint/travis-ci_scripts/10_before_install.bash @@ -1,5 +1,7 @@ #!/bin/bash +export SHORT_CIRCUIT_SMOKE + # Stop pre-started RDBMS and sync for some settle time run_or_err "Stopping MySQL" "sudo /etc/init.d/mysql stop" run_or_err "Stopping PostgreSQL" "sudo /etc/init.d/postgresql stop || /bin/true" @@ -25,6 +27,17 @@ Under Travis this state usually results in a failed build. Short-circuiting buildjob to avoid false negatives, please restart it manually. =============================================================================" + +# pull requests are always scrutinized after the fact anyway - run a +# a simpler matrix +elif [[ "$TRAVIS_PULL_REQUEST" != "false" ]]; then + if [[ -n "$BREWVER" ]]; then + # just don't brew anything + SHORT_CIRCUIT_SMOKE=1 + else + # running PRs with 1 thread is non-sensical + VCPU_USE="" + fi fi if [[ -n "$SHORT_CIRCUIT_SMOKE" ]] ; then return ; fi @@ -40,14 +53,16 @@ if [[ -n "$SHORT_CIRCUIT_SMOKE" ]] ; then return ; fi # # We also divide the result by a factor, otherwise the travis VM gets # overloaded (the amount of available swap is just TOOOO damn small) -if [[ -z "$NUMTHREADS" ]] ; then - export NUMTHREADS="$(( ( $(perl -0777 -n -e 'print (/ (?: .+ ^ processor \s+ : \s+ (\d+) ) (?! ^ processor ) /smx)' < /proc/cpuinfo) + 1 ) / 3 ))" +export VCPU_AVAILABLE="$(( ( $(perl -0777 -n -e 'print (/ (?: .+ ^ processor \s+ : \s+ (\d+) ) (?! ^ processor ) /smx)' < /proc/cpuinfo) + 1 ) / 3 ))" + +if [[ -z "$VCPU_USE" ]] ; then + export VCPU_USE="$VCPU_AVAILABLE" fi export CACHE_DIR="/tmp/poormanscache" # these will be installed no matter what, also some extras unless CLEANTEST -common_packages="libapp-nopaste-perl tree" +common_packages="libapp-nopaste-perl" if [[ "$CLEANTEST" = "true" ]]; then @@ -60,6 +75,9 @@ else sudo bash -c 'echo -e "firebird2.5-super\tshared/firebird/enabled\tboolean\ttrue" | debconf-set-selections' sudo bash -c 'echo -e "firebird2.5-super\tshared/firebird/sysdba_password/new_password\tpassword\t123" | debconf-set-selections' + # these APT sources do not mean anything to us anyway + sudo rm -rf /etc/apt/sources.list.d/* + run_or_err "Updating APT sources" "sudo apt-get update" apt_install $common_packages libmysqlclient-dev memcached firebird2.5-super firebird2.5-dev unixodbc-dev expect @@ -118,6 +136,24 @@ else "echo \"CREATE DATABASE '/var/lib/firebird/2.5/data/dbic_test.fdb';\" | sudo isql-fb -u sysdba -p 123" then + run_or_err "Fetching and building Firebird ODBC driver" ' + cd "$(mktemp -d)" + wget -qO- http://sourceforge.net/projects/firebird/files/firebird-ODBC-driver/2.0.2-Release/OdbcFb-Source-2.0.2.153.gz/download | tar -zx + cd Builds/Gcc.lin + perl -p -i -e "s|/usr/lib64|/usr/lib/x86_64-linux-gnu|g" ../makefile.environ + make -f makefile.linux + sudo make -f makefile.linux install + ' + + sudo bash -c 'cat >> /etc/odbcinst.ini' <<< " +[Firebird] +Description = InterBase/Firebird ODBC Driver +Driver = /usr/lib/x86_64-linux-gnu/libOdbcFb.so +Setup = /usr/lib/x86_64-linux-gnu/libOdbcFb.so +Threading = 1 +FileUsage = 1 +" + export DBICTEST_FIREBIRD_DSN=dbi:Firebird:dbname=/var/lib/firebird/2.5/data/dbic_test.fdb export DBICTEST_FIREBIRD_USER=SYSDBA export DBICTEST_FIREBIRD_PASS=123 @@ -126,6 +162,10 @@ else export DBICTEST_FIREBIRD_INTERBASE_USER=SYSDBA export DBICTEST_FIREBIRD_INTERBASE_PASS=123 + export DBICTEST_FIREBIRD_ODBC_DSN="dbi:ODBC:Driver=Firebird;Dbname=/var/lib/firebird/2.5/data/dbic_test.fdb" + export DBICTEST_FIREBIRD_ODBC_USER=SYSDBA + export DBICTEST_FIREBIRD_ODBC_PASS=123 + break fi diff --git a/maint/travis-ci_scripts/20_install.bash b/maint/travis-ci_scripts/20_install.bash index 7118a0a..279dafd 100755 --- a/maint/travis-ci_scripts/20_install.bash +++ b/maint/travis-ci_scripts/20_install.bash @@ -9,7 +9,7 @@ CPAN_MIRROR="http://cpan.metacpan.org/" PERL_CPANM_OPT="$PERL_CPANM_OPT --mirror $CPAN_MIRROR" # do not set PERLBREW_CPAN_MIRROR - not all backpan-like mirrors have the perl tarballs -export PERL_MM_USE_DEFAULT=1 PERL_MM_NONINTERACTIVE=1 PERL_AUTOINSTALL_PREFER_CPAN=1 HARNESS_TIMER=1 MAKEFLAGS="-j$NUMTHREADS" +export PERL_MM_USE_DEFAULT=1 PERL_MM_NONINTERACTIVE=1 PERL_AUTOINSTALL_PREFER_CPAN=1 HARNESS_TIMER=1 MAKEFLAGS="-j$VCPU_USE" # try CPAN's latest offering if requested if [[ "$DEVREL_DEPS" == "true" ]] ; then @@ -25,7 +25,7 @@ if [[ -n "$BREWVER" ]] ; then # since perl 5.14 a perl can safely be built concurrently with -j$large # (according to brute force testing and my power bill) if [[ "$BREWVER" == "blead" ]] || perl -Mversion -e "exit !!(version->new(q($BREWVER)) < 5.014)" ; then - perlbrew_jopt="$NUMTHREADS" + perlbrew_jopt="$VCPU_USE" fi run_or_err "Compiling/installing Perl $BREWVER (without testing, using ${perlbrew_jopt:-1} threads, may take up to 5 minutes)" \ @@ -44,26 +44,8 @@ if [[ -n "$BREWVER" ]] ; then # no brewver - this means a travis perl, which means we want to clean up # the presently installed libs -# Idea stolen from -# https://github.com/kentfredric/Dist-Zilla-Plugin-Prereqs-MatchInstalled-All/blob/master/maint-travis-ci/sterilize_env.pl -# Only works on 5.12+ (where sitelib was finally properly fixed) -elif [[ "$CLEANTEST" == "true" ]] && [[ "$POISON_ENV" != "true" ]] && perl -M5.012 -e 1 &>/dev/null ; then - - echo_err "$(tstamp) Cleaning precompiled Travis-Perl" - perl -M5.012 -MConfig -MFile::Find -e ' - my $sitedirs = { - map { $Config{$_} => 1 } - grep { $_ =~ /site(lib|arch)exp$/ } - keys %Config - }; - find({ bydepth => 1, no_chdir => 1, follow_fast => 1, wanted => sub { - ! $sitedirs->{$_} and ( -d _ ? rmdir : unlink ) - } }, keys %$sitedirs ) - ' - - echo_err "Post-cleanup contents of sitelib of the pre-compiled Travis-Perl $TRAVIS_PERL_VERSION:" - echo_err "$(tree $(perl -MConfig -e 'print $Config{sitelib_stem}'))" - echo_err +elif [[ "$CLEANTEST" == "true" ]] && [[ "$POISON_ENV" != "true" ]] ; then + purge_sitelib fi # configure CPAN.pm - older versions go into an endless loop diff --git a/maint/travis-ci_scripts/30_before_script.bash b/maint/travis-ci_scripts/30_before_script.bash index c4f0f62..4f5007d 100755 --- a/maint/travis-ci_scripts/30_before_script.bash +++ b/maint/travis-ci_scripts/30_before_script.bash @@ -58,8 +58,8 @@ if [[ "$CLEANTEST" = "true" ]]; then if [[ "$DEVREL_DEPS" != "true" ]] && ! CPAN_is_sane ; then # no configure_requires - we will need the usual suspects anyway - # without pre-installing these in one pass things like extract_prereqs won't work - installdeps ExtUtils::MakeMaker ExtUtils::CBuilder Module::Build + # without pre-installing these in one pass things won't yet work + installdeps Module::Build fi else @@ -70,16 +70,15 @@ else # (e.g. once Carp is upgraded there's no more Carp::Heavy, # while a File::Path upgrade may cause a parallel EUMM run to fail) # - parallel_installdeps_notest ExtUtils::MakeMaker parallel_installdeps_notest File::Path parallel_installdeps_notest Carp parallel_installdeps_notest Module::Build - parallel_installdeps_notest File::Spec Data::Dumper Module::Runtime + parallel_installdeps_notest File::Spec Module::Runtime parallel_installdeps_notest Test::Exception Encode::Locale Test::Fatal parallel_installdeps_notest Test::Warn B::Hooks::EndOfScope Test::Differences HTTP::Status parallel_installdeps_notest Test::Pod::Coverage Test::EOL Devel::GlobalDestruction Sub::Name MRO::Compat Class::XSAccessor URI::Escape HTML::Entities parallel_installdeps_notest YAML LWP Class::Trigger DateTime::Format::Builder Class::Accessor::Grouped Package::Variant - parallel_installdeps_notest SQL::Abstract Moose Module::Install JSON SQL::Translator File::Which + parallel_installdeps_notest SQL::Abstract Moose Module::Install@1.15 JSON SQL::Translator File::Which Class::DBI::Plugin # the official version is very much outdated and does not compile on 5.14+ # use this rather updated source tree (needs to go to PAUSE): @@ -100,11 +99,11 @@ if [[ "$CLEANTEST" = "true" ]]; then # we are doing a devrel pass - try to upgrade *everything* (we will be using cpanm so safe-ish) if [[ "$DEVREL_DEPS" == "true" ]] ; then - HARD_DEPS="$(echo $(make listalldeps))" + HARD_DEPS="$(make listalldeps | sort -R)" else - HARD_DEPS="$(echo $(make listdeps | sort -R))" + HARD_DEPS="$(make listdeps | sort -R)" ##### TEMPORARY WORKAROUNDS needed in case we will be using a fucked CPAN.pm if ! CPAN_is_sane ; then @@ -112,24 +111,6 @@ if [[ "$CLEANTEST" = "true" ]]; then # DBD::SQLite reasonably wants DBI at config time perl -MDBI -e1 &>/dev/null || HARD_DEPS="DBI $HARD_DEPS" - # this is a fucked CPAN - won't understand configure_requires of - # various pieces we may run into - # FIXME - need to get these off metacpan or something instead - HARD_DEPS="ExtUtils::Depends B::Hooks::OP::Check $HARD_DEPS" - - if CPAN_supports_BUILDPL ; then - # We will invoke a posibly MBT based BUILD-file, but we do not support - # configure requires. So we not only need to install MBT but its prereqs - # FIXME This is madness - HARD_DEPS="$(extract_prereqs Module::Build::Tiny) Module::Build::Tiny $HARD_DEPS" - else - # FIXME - # work around Params::Validate not having a Makefile.PL so really old - # toolchains can not figure out what the prereqs are ;( - # Need to do more research before filing a bug requesting Makefile inclusion - HARD_DEPS="$(extract_prereqs Params::Validate) $HARD_DEPS" - fi - fi ##### END TEMPORARY WORKAROUNDS @@ -139,7 +120,7 @@ if [[ "$CLEANTEST" = "true" ]]; then else - parallel_installdeps_notest "$(make listdeps)" + parallel_installdeps_notest "$(make listdeps | sort -R)" fi @@ -163,6 +144,10 @@ if [[ "$POISON_ENV" = "true" ]] && ( perl -MDBD::SQLite\ 1.38 -e1 || perl -MDBI\ exit 1 fi +if [[ "$CLEANTEST" = "true" ]] && perl -MModule::Build::Tiny -e1 &>/dev/null ; then + echo_err "Module::Build::Tiny pulled in during the basic depchain install - this must not happen" + exit 1 +fi # announce what are we running echo_err " diff --git a/maint/travis-ci_scripts/40_script.bash b/maint/travis-ci_scripts/40_script.bash index 2daea0a..062f796 100755 --- a/maint/travis-ci_scripts/40_script.bash +++ b/maint/travis-ci_scripts/40_script.bash @@ -6,7 +6,7 @@ source maint/travis-ci_scripts/common.bash if [[ -n "$SHORT_CIRCUIT_SMOKE" ]] ; then exit 0 ; fi run_harness_tests() { - local -x HARNESS_OPTIONS=c:j$NUMTHREADS + local -x HARNESS_OPTIONS=c:j$VCPU_USE make test 2> >(tee "$TEST_STDERR_LOG") } @@ -19,7 +19,7 @@ if [[ "$CLEANTEST" = "true" ]] ; then run_or_err "Prepare blib" "make pure_all" run_harness_tests else - PROVECMD="prove -lrswj$NUMTHREADS xt t" + PROVECMD="prove -lrswj$VCPU_USE xt t" # FIXME - temporary, until Package::Stash is fixed if perl -M5.010 -e 1 &>/dev/null ; then diff --git a/maint/travis-ci_scripts/50_after_success.bash b/maint/travis-ci_scripts/50_after_success.bash index a7b78dd..69feec2 100755 --- a/maint/travis-ci_scripts/50_after_success.bash +++ b/maint/travis-ci_scripts/50_after_success.bash @@ -3,15 +3,87 @@ # this file is executed in a subshell - set up the common stuff source maint/travis-ci_scripts/common.bash -if [[ -n "$SHORT_CIRCUIT_SMOKE" ]] ; then exit 0 ; fi +if [[ -n "$SHORT_CIRCUIT_SMOKE" ]] || [[ "$TRAVIS_PULL_REQUEST" != "false" ]] ; then exit 0 ; fi -if [[ "$CLEANTEST" != "true" ]] ; then +# this part needs to run in parallel unconditionally +export VCPU_USE="$VCPU_AVAILABLE" +export HARNESS_OPTIONS="j$VCPU_USE" + + +if [[ "$DEVREL_DEPS" == "true" ]] && perl -M5.008003 -e1 &>/dev/null ; then + # FIXME - these really need to be installed *with* testing under "allowed failures" + # Change when Moose goes away + parallel_installdeps_notest Moose + parallel_installdeps_notest $(perl -Ilib -MDBIx::Class::Optional::Dependencies=-list_missing,dist_dir) + + run_or_err "Attempt to build a dist" "rm -rf inc/ && perl Makefile.PL --skip-author-deps && make dist" + tarball_assembled=1 + +elif [[ "$CLEANTEST" != "true" ]] ; then parallel_installdeps_notest $(perl -Ilib -MDBIx::Class::Optional::Dependencies=-list_missing,dist_dir) - run_or_err "Attempt to build a dist with all prereqs present" "make dist" + + run_or_err "Attempt to build a dist from original checkout" "make dist" + tarball_assembled=1 +fi + + +if [[ -n "$tarball_assembled" ]] ; then + echo "Contents of the resulting dist tarball:" echo "===========================================" tar -vzxf DBIx-Class-*.tar.gz echo "===========================================" - run_or_err 'Attempt to configure from re-extracted distdir' \ - 'bash -c "cd \$(find DBIx-Class-* -maxdepth 0 -type d | head -n 1) && perl Makefile.PL"' + + # kill as much as possible with fire + purge_sitelib + + + # undo some of the pollution (if any) affecting the plain install deps + # FIXME - this will go away once we move off Moose, and a new SQLT + # with much less recommends ships + export DBICTEST_SQLT_DEPLOY="" + export DBICTEST_VIA_REPLICATED="" + + + # make sure we are retrying with newest CPAN possible + # + # not running tests on CPAN.pm - they are not terribly slow, + # but https://rt.cpan.org/Ticket/Display.html?id=96437 sucks + parallel_installdeps_notest CPAN + run_or_err "Make sure CPAN was upgraded to at least 2.10" "perl -M'CPAN 2.010' -e1" + + run_or_err "Re-Configuring CPAN.pm" "perl -MCPAN -e '\ + CPAN::Config->load; + + # For the time being smoking with this setting is not realistic + # https://rt.cpan.org/Ticket/Display.html?id=103280 + # https://rt.cpan.org/Ticket/Display.html?id=37641 + # https://rt.cpan.org/Ticket/Display.html?id=77708 + # https://rt.cpan.org/Ticket/Display.html?id=87474 + #\$CPAN::Config->{build_requires_install_policy} = q{no}; + + \$CPAN::Config->{recommends_policy} = q{yes}; + CPAN::Config->commit; + '" + + cd "$(find DBIx-Class-* -maxdepth 0 -type d | head -n 1)" + + # only run a full test cycle on devrel_deps, as they are all marked + # as "allow fails" in the travis matrix + if [[ "$DEVREL_DEPS" == "true" ]] ; then + + for e in $( env | grep 'DBICTEST.*DSN' | cut -f 1 -d '=' ) ; do + echo "Unsetting $e" + export $e="" + done + + run_or_err \ + "Attempt to configure/test/build/install dist using latest CPAN@$(perl -MCPAN -e 'print CPAN->VERSION')" \ + "cpan ." + + else + run_or_err \ + "Attempt to configure/build/install dist using latest CPAN@$(perl -MCPAN -e 'print CPAN->VERSION')" \ + "perl -MCPAN -e 'notest( install => q{.} )'" + fi fi diff --git a/maint/travis-ci_scripts/common.bash b/maint/travis-ci_scripts/common.bash index f44b36e..1f4df78 100755 --- a/maint/travis-ci_scripts/common.bash +++ b/maint/travis-ci_scripts/common.bash @@ -155,7 +155,7 @@ parallel_installdeps_notest() { run_or_err "Installing (without testing) $(echo $MODLIST)" \ "echo \\ \"$MODLIST\" \\ - | xargs -d '\\n' -n 1 -P $NUMTHREADS bash -c \\ + | xargs -d '\\n' -n 1 -P $VCPU_USE bash -c \\ 'OUT=\$(maint/getstatus $TIMEOUT_CMD cpanm --notest \"\$@\" 2>&1 ) || (LASTEXIT=\$?; echo \"\$OUT\"; exit \$LASTEXIT)' \\ 'giant space monkey penises' " @@ -168,7 +168,7 @@ installdeps() { local -x HARNESS_OPTIONS - HARNESS_OPTIONS="j$NUMTHREADS" + HARNESS_OPTIONS="j$VCPU_USE" if ! run_or_err "Attempting install of $# modules under parallel ($HARNESS_OPTIONS) testing ($MODLIST)" "_dep_inst_with_test $MODLIST" quiet_fail ; then local errlog="failed after ${DELTA_TIME}s Exit:$LASTEXIT Log:$(/usr/bin/nopaste -q -s Shadowcat -d "Parallel testfail" <<< "$LASTOUT")" @@ -190,17 +190,20 @@ _dep_inst_with_test() { if [[ "$DEVREL_DEPS" == "true" ]] ; then # --dev is already part of CPANM_OPT LASTCMD="$TIMEOUT_CMD cpanm $@" - $LASTCMD 2>&1 + $LASTCMD 2>&1 || return 1 else LASTCMD="$TIMEOUT_CMD cpan $@" - $LASTCMD 2>&1 + $LASTCMD 2>&1 || return 1 # older perls do not have a CPAN which can exit with error on failed install for m in "$@"; do if ! perl -e ' +$ARGV[0] =~ s/-TRIAL\.//; + my $mod = ( - $ARGV[0] =~ m{ \/ .*? ([^\/]+) $ }x + # abuse backtrack + $ARGV[0] =~ m{ / .*? ( [^/]+ ) $ }x ? do { my @p = split (/\-/, $1); pop @p; join "::", @p } : $ARGV[0] ); @@ -217,6 +220,70 @@ eval qq{require($mod)} or ( print $@ and exit 1) fi } +# Idea stolen from +# https://github.com/kentfredric/Dist-Zilla-Plugin-Prereqs-MatchInstalled-All/blob/master/maint-travis-ci/sterilize_env.pl +# Only works on 5.12+ (where sitelib was finally properly fixed) +purge_sitelib() { + echo_err "$(tstamp) Sterilizing the Perl installation (cleaning up sitelib)" + + if perl -M5.012 -e1 &>/dev/null ; then + + perl -M5.012 -MConfig -MFile::Find -e ' + my $sitedirs = { + map { $Config{$_} => 1 } + grep { $_ =~ /site(lib|arch)exp$/ } + keys %Config + }; + find({ bydepth => 1, no_chdir => 1, follow_fast => 1, wanted => sub { + ! $sitedirs->{$_} and ( -d _ ? rmdir : unlink ) + } }, keys %$sitedirs ) + ' + else + + cl_fn="/tmp/${TRAVIS_BUILD_ID}_Module_CoreList.pm"; + + [[ -s "$cl_fn" ]] || run_or_err \ + "Downloading latest Module::CoreList" \ + "curl -s --compress -o '$cl_fn' https://api.metacpan.org/source/Module::CoreList" + + perl -0777 -Ilib -MDBIx::Class::Optional::Dependencies -e ' + + # this is horrible, but really all we want is "has this ever been used" + # so a grep without a load is quite legit (and horrible) + my $mcl_source = <>; + + my @all_possible_never_been_core_modpaths = map + { (my $mp = $_ . ".pm" ) =~ s|::|/|g; $mp } + grep + { $mcl_source !~ / ^ \s+ \x27 $_ \x27 \s* \=\> /mx } + ( + qw( + Module::Build::Tiny + ), + keys %{ DBIx::Class::Optional::Dependencies->modreq_list_for([ + keys %{ DBIx::Class::Optional::Dependencies->req_group_list } + ])} + ) + ; + + # now that we have the list we can go ahead and destroy every single one + # of these modules without being concerned about breaking the base ability + # to install things + for my $mp ( sort { lc($a) cmp lc($b) } @all_possible_never_been_core_modpaths ) { + for my $incdir (@INC) { + -e "$incdir/$mp" + and + unlink "$incdir/$mp" + and + print "Nuking $incdir/$mp\n" + } + } + ' "$cl_fn" + + fi +} + + CPAN_is_sane() { perl -MCPAN\ 1.94_56 -e 1 &>/dev/null ; } CPAN_supports_BUILDPL() { perl -MCPAN\ 1.9205 -e1 &>/dev/null; } diff --git a/t/lib/DBICTest.pm b/t/lib/DBICTest.pm index 39a8af9..229859d 100644 --- a/t/lib/DBICTest.pm +++ b/t/lib/DBICTest.pm @@ -13,6 +13,7 @@ use Path::Class::File (); use File::Spec; use Fcntl qw/:DEFAULT :flock/; use Config; +use Scope::Guard (); =head1 NAME @@ -386,8 +387,11 @@ sub deploy_schema { my $schema = shift; my $args = shift || {}; - local $schema->storage->{debug} - if ($ENV{TRAVIS}||'') eq 'true'; + my $guard; + if ( ($ENV{TRAVIS}||'') eq 'true' and my $old_dbg = $schema->storage->debug ) { + $guard = Scope::Guard->new(sub { $schema->storage->debug($old_dbg) }); + $schema->storage->debug(0); + } if ($ENV{"DBICTEST_SQLT_DEPLOY"}) { $schema->deploy($args); @@ -417,8 +421,11 @@ sub populate_schema { my $self = shift; my $schema = shift; - local $schema->storage->{debug} - if ($ENV{TRAVIS}||'') eq 'true'; + my $guard; + if ( ($ENV{TRAVIS}||'') eq 'true' and my $old_dbg = $schema->storage->debug ) { + $guard = Scope::Guard->new(sub { $schema->storage->debug($old_dbg) }); + $schema->storage->debug(0); + } $schema->populate('Genre', [ [qw/genreid name/], diff --git a/t/lib/DBICTest/RunMode.pm b/t/lib/DBICTest/RunMode.pm index 39661a1..ee16bc1 100644 --- a/t/lib/DBICTest/RunMode.pm +++ b/t/lib/DBICTest/RunMode.pm @@ -208,7 +208,7 @@ sub is_ci { return ( ($ENV{TRAVIS}||'') eq 'true' and - ($ENV{TRAVIS_REPO_SLUG}||'') eq 'dbsrgits/dbix-class' + ($ENV{TRAVIS_REPO_SLUG}||'') =~ m|\w+/dbix-class$| ) }