From: Peter Rabbitson Date: Wed, 15 Jun 2016 12:30:13 +0000 (+0200) Subject: (travis) Port all travis changes since 0.08270 X-Git-Tag: v0.08271~1 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=83c94794023c57cb524e10892c230a335307f4aa;p=dbsrgits%2FDBIx-Class.git (travis) Port all travis changes since 0.08270 --- diff --git a/.travis.yml b/.travis.yml index ed2c04e..48f0a2d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,35 +6,14 @@ # # * Minimum perl officially supported by DBIC is 5.8.3. This *includes* the # basic depchain. On failure either attempt to fix it or bring it to the -# attention of ribasushi. *DO NOT* disable 5.8 testing - it is here for a -# reason -# -# * The matrix is built from two main modes - CLEANTEST = [true|false]. -# - In the first case we test with minimal deps available, and skip everything -# listed in DBIC::OptDesps. The modules are installed with classic CPAN -# invocations and are *fully tested*. In other words we simulate what would -# happen if a user tried to install on a just-compiled virgin perl -# - Without CLEANTEST we bring the armada of RDBMS and install the maximum -# 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 testing of dependencies under CLEANTEST runs single-threaded, at least -# until we fix our entire dep-chain to safely pass under -j -# -# * The way .travis.yml is fed to the command controller is idiotic - it -# makes using multiline `bash -c` statements impossible. Therefore to -# aid readability (our travis logic is rather complex), the bulk of -# functionality is moved to scripts. More about the problem (and the -# WONTFIX "explanation") here: https://github.com/travis-ci/travis-ci/issues/497 +# attention of the maintainer. *DO NOT* disable 5.8 testing - it is here for +# a very good reason # +# the entire run times out after 50 minutes, or after 5 minutes without +# console output # # Smoke all branches except for blocked* and wip/* -# -# Additionally master does not smoke with bleadperl -# ( implemented in maint/travis-ci_scripts/10_before_install.bash ) -# branches: except: - /^wip\// @@ -52,212 +31,355 @@ notifications: email: recipients: - - ribasushi@cpan.org - # Temporary - if it proves to be too noisy, we'll shut it off - #- dbix-class-devel@lists.scsys.co.uk + - CPAN-CI@leporine.io on_success: change on_failure: always -# FIXME - This stuff is not yet available for free OSS accounts, sadpanda -# First paragrah on http://about.travis-ci.org/docs/user/caching/ -#cache: -# apt: true -# directories: -# - /var/cache/apt/archives +addons: + apt: + packages: + - libapp-nopaste-perl + - net-tools +# This is probably a net-loss for setup etc - a bare 'C' will likely fare much better language: perl -perl: - - "5.18" +# Currently not trying osx: https://github.com/travis-ci/travis-ci/issues/2314 +os: linux -env: - - CLEANTEST=false - - CLEANTEST=true +# The defaults run under the more rapid container infra. The hardware is +# actually *much* slower, but the jobs start much faster, for more info see +# https://docs.travis-ci.com/user/ci-environment/#Virtualization-environments +# Combined with 'fast_finish' this will result in an "uh-oh" email as early +# as possible +dist: precise +sudo: false +env: CLEANTEST=true + +perl: + - "5.8" + - "5.10" + - "5.22-extras" matrix: + fast_finish: true + include: - # this particular perl is quite widespread - - perl: 5.8.8_thr_mb + + # Same as the "master matrix" above, frozen under older dist/infrastructure + # In genereal it is strongly recommended to keep things on the older + # version indefinitely - there is little value in-depth smoking on + # more recent software stacks + - perl: "5.8" + sudo: required + dist: precise env: - - CLEANTEST=true - - BREWOPTS="-Duseithreads -Dusemorebits" - - BREWVER=5.8.8 + - CLEANTEST=false - # so is this one (test a sane CPAN.pm) - - perl: 5.12.4_thr_mb + - perl: "5.10" + sudo: required + dist: precise env: - - CLEANTEST=true - - BREWOPTS="-Duseithreads -Dusemorebits" - - BREWVER=5.12.4 + - CLEANTEST=false - # this is the perl suse ships - - perl: 5.10.0_thr_dbg + - perl: "5.22-extras" + sudo: required + dist: precise env: - - CLEANTEST=true - - BREWOPTS="-DDEBUGGING -Duseithreads" - - BREWVER=5.10.0 + - CLEANTEST=false - # CLEANTEST of minimum supported - - perl: 5.8.3_nt_mb + # CLEANTEST of minimum supported with non-tracing poisoning, single thread (hence the sudo) + - perl: "5.8.3_nt_mb" + sudo: required + dist: precise env: + - VCPU_USE=1 - CLEANTEST=true + - POISON_ENV=true + - DBIC_TRACE_PROFILE=console_monochrome + - BREWVER=5.8.3 - BREWOPTS="-Dusemorebits" + + # Full Test of minimum supported without threads with plain poisoned trace + - perl: "5.8.3_nt" + sudo: required + dist: precise + # run these under legacy - great simulation of low memory env + group: legacy + env: + - CLEANTEST=false + - POISON_ENV=true + - DBIC_TRACE=1 - BREWVER=5.8.3 - # Full Test of minimum supported with threads - - perl: 5.8.5_thr + # Full Test of minimum supported with threads with non-tracing poisoning + - perl: "5.8.5_thr" + sudo: required + dist: precise + # run these under legacy - great simulation of low memory env + group: legacy env: - CLEANTEST=false - - BREWOPTS="-Duseithreads" + - POISON_ENV=true + - DBIC_TRACE_PROFILE=console - BREWVER=5.8.5 + - BREWOPTS="-Duseithreads" + + # CLEANTEST of solaris-like perl with non-tracing poisoning + - perl: "5.8.4_nt" + sudo: false + dist: precise + env: + - CLEANTEST=true + - POISON_ENV=true - DBIC_TRACE_PROFILE=console + - BREWVER=5.8.4 - # Full Test of minimum supported without threads - - perl: 5.8.3_nt + # Full test: this particular perl is quite widespread, single thread + - perl: "5.8.8_thr" + sudo: required + dist: precise + group: legacy env: + - VCPU_USE=1 - CLEANTEST=false - - BREWOPTS="" - - BREWVER=5.8.3 - - DBIC_TRACE_PROFILE=console_monochrome - - ### - # some permutations of tracing and envvar poisoning + - BREWVER=5.8.8 + - BREWOPTS="-Duseithreads" - - perl: 5.16.2_thr_mb + # CLEANTEST: this is the perl suse ships, with env poisoning + - perl: "5.10.0_thr_dbg" + sudo: false + dist: precise env: - - CLEANTEST=false + - CLEANTEST=true - POISON_ENV=true - - DBIC_TRACE=1 - - DBIC_MULTICREATE_DEBUG=0 - - BREWOPTS="-Duseithreads -Dusemorebits" - - BREWVER=5.16.2 + - BREWVER=5.10.0 + - BREWOPTS="-DDEBUGGING -Duseithreads" - - perl: 5.18 + # CLEANTEST: this one is in a number of debian-based LTS (test a sane CPAN.pm, single thread) + - perl: "5.14.2_thr_mb" + sudo: required + dist: precise env: - - CLEANTEST=false - - POISON_ENV=true - - DBIC_TRACE_PROFILE=console + - VCPU_USE=1 + - CLEANTEST=true + - BREWVER=5.14.2 + - BREWOPTS="-Duseithreads -Dusemorebits" - - perl: 5.8 + ### + # some permutations of tracing and envvar poisoning + + - perl: "5.12.3_thr" + sudo: false + dist: precise env: - CLEANTEST=true - POISON_ENV=true - DBIC_TRACE=1 + - DBIC_MULTICREATE_DEBUG=1 + - DBIC_STORAGE_RETRY_DEBUG=1 - DBIC_TRACE_PROFILE=console + - BREWVER=5.12.3 + - BREWOPTS="-Duseithreads" - - perl: 5.18 + - perl: "5.16.3_thr_mb" + sudo: required + dist: precise + env: + - CLEANTEST=false + - DBIC_TRACE=1 + - DBICTEST_VERSION_WARNS_INDISCRIMINATELY=1 + - BREWVER=5.16.3 + - BREWOPTS="-Duseithreads -Dusemorebits" + + - perl: "5.18-extras" + sudo: required + # explicit new infra spec preparing for a future forced upgrade + dist: trusty env: - CLEANTEST=false - POISON_ENV=true - DBIC_TRACE=1 - DBIC_TRACE_PROFILE=console_monochrome - - DBIC_MULTICREATE_DEBUG=0 + - DBICTEST_VIA_REPLICATED=0 + - DBICTEST_VERSION_WARNS_INDISCRIMINATELY=1 ### # Start of the allow_failures block - # old threaded with blead CPAN - - perl: devcpan_5.8.7_thr + # threaded oldest possible with blead CPAN + - perl: "devcpan_5.8.1_thr_mb" + sudo: false + dist: precise env: - CLEANTEST=true - - BREWOPTS="-Duseithreads" - - BREWVER=5.8.7 - DEVREL_DEPS=true + - BREWVER=5.8.1 + - BREWOPTS="-Duseithreads -Dusemorebits" - # 5.10.0 threaded with blead CPAN - - perl: devcpan_5.10.0_thr_mb + # oldest possible with blead CPAN with poisoning and plain trace + - perl: "devcpan_5.8.1" + sudo: false + dist: precise env: - CLEANTEST=true - - BREWOPTS="-Duseithreads -Dusemorebits" - - BREWVER=5.10.0 - DEVREL_DEPS=true + - POISON_ENV=true + - DBIC_TRACE=1 + - DBICTEST_VERSION_WARNS_INDISCRIMINATELY=1 + - BREWVER=5.8.1 + + # 5.8.3 with blead CPAN + - perl: "devcpan_5.8.3_mb" + sudo: required + # explicit new infra spec preparing for a future forced upgrade + dist: trusty + env: + - CLEANTEST=false + - DEVREL_DEPS=true + - BREWVER=5.8.3 + - BREWOPTS="-Dusemorebits" - # 5.12.2 with blead CPAN - - perl: devcpan_5.12.2_thr + # 5.8.7 threaded with blead CPAN with non-tracing poisoning + - perl: "devcpan_5.8.7_thr" + sudo: false + dist: precise env: - CLEANTEST=true + - DEVREL_DEPS=true + - POISON_ENV=true + - BREWVER=5.8.7 - BREWOPTS="-Duseithreads" - - BREWVER=5.12.2 + + # 5.8.8 threaded MB (exercises P5#72210) + - perl: "devcpan_5.8.8_thr_mb" + sudo: false + dist: precise + env: + - CLEANTEST=true + - DBICTEST_VERSION_WARNS_INDISCRIMINATELY=1 - DEVREL_DEPS=true + - BREWVER=5.8.8 + - BREWOPTS="-Duseithreads -Dusemorebits" - # recentish threaded stable with blead CPAN - - perl: devcpan_5.18.2_thr_mb + # 5.10.0 threaded with blead CPAN + - perl: "devcpan_5.10.0_thr_mb" + sudo: false + dist: precise env: - - CLEANTEST=false + - CLEANTEST=true + - DEVREL_DEPS=true + - BREWVER=5.10.0 - BREWOPTS="-Duseithreads -Dusemorebits" - - BREWVER=5.18.2 + + # 5.12.1 with blead CPAN + - perl: "devcpan_5.12.1_thr" + sudo: false + dist: precise + env: + - CLEANTEST=true - DEVREL_DEPS=true + - BREWVER=5.12.1 + - BREWOPTS="-Duseithreads" - # bleadperl with stock CPAN, full depchain test - - perl: bleadperl + # bleadperl with stock CPAN, full depchain test with non-tracing poisoning, single thread + - perl: "bleadperl" + sudo: required + dist: precise env: + - VCPU_USE=1 - CLEANTEST=true + - POISON_ENV=true - BREWVER=blead - # bleadperl with blead CPAN - - perl: devcpan_bleadperl_thr_mb + # bleadperl with blead CPAN, single thread + - perl: "devcpan_bleadperl_thr_mb" + sudo: required + # explicitly do not specify dist - see what the default does env: + - VCPU_USE=1 - CLEANTEST=false - - BREWOPTS="-Duseithreads -Dusemorebits" - - BREWVER=blead - DEVREL_DEPS=true - + - BREWVER=blead + - BREWOPTS="-Duseithreads -Dusemorebits" # which ones of the above can fail allow_failures: # these run with various dev snapshots - allowed to fail + - perl: devcpan_5.8.1_thr_mb + - perl: devcpan_5.8.1 + - perl: devcpan_5.8.3_mb - perl: devcpan_5.8.7_thr + - perl: devcpan_5.8.8_thr_mb - perl: devcpan_5.10.0_thr_mb - - perl: devcpan_5.12.2_thr - - perl: devcpan_5.18.2_thr_mb + - perl: devcpan_5.12.1_thr - perl: bleadperl - perl: devcpan_bleadperl_thr_mb -# sourcing the files is *EXTREMELY* important - otherwise -# no envvars will survive - -# the entire run times out after 50 minutes, or after 5 minutes without -# console output +### +### For the following two phases -e is *set* +### before_install: + # common functions for all run phases below + # + # this is an exporter - sourcing it is crucial + # among other things it also sets -e + # + - source maint/travis-ci_scripts/common.bash + # Sets global envvars, downloads/configures debs based on CLEANTEST # Sets extra DBICTEST_* envvars # + # this is an exporter - sourcing it is crucial + # - source maint/travis-ci_scripts/10_before_install.bash install: # Build and switch to a custom perl if requested # Configure the perl env, preinstall some generic toolchain parts + # Possibly poison the environment + # + # this is an exporter - sourcing it is crucial # - source maint/travis-ci_scripts/20_install.bash +### +### From this point on -e is *unset*, rely on travis' error handling +### + - set +e + before_script: # Preinstall/install deps based on envvars/CLEANTEST # - - source maint/travis-ci_scripts/30_before_script.bash + # need to invoke the after_failure script manually + # because 'after_failure' runs only after 'script' fails + # + - maint/getstatus maint/travis-ci_scripts/30_before_script.bash script: # Run actual tests # - - source maint/travis-ci_scripts/40_script.bash + - 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 + # Disabled # - - source maint/travis-ci_scripts/50_after_success.bash + #- maint/getstatus maint/travis-ci_scripts/50_after_success.bash after_failure: - # No tasks yet + # Final sysinfo printout on fail # - #- source maint/travis-ci_scripts/50_after_failure.bash + - maint/getstatus maint/travis-ci_scripts/50_after_failure.bash after_script: # No tasks yet # - #- source maint/travis-ci_scripts/60_after_script.bash - - # if we do not unset this before we terminate the travis teardown will - # mark the entire job as failed - - set +e + #- maint/getstatus maint/travis-ci_scripts/60_after_script.bash diff --git a/maint/getstatus b/maint/getstatus new file mode 100755 index 0000000..f49c410 --- /dev/null +++ b/maint/getstatus @@ -0,0 +1,52 @@ +#!/usr/bin/perl + +use warnings; +use strict; + +use Config; +use Term::ANSIColor ':constants'; +my $CRST = RESET; +my $CCODE = BOLD; +my $CSTAT = BOLD . GREEN; +my $CCORE = BOLD . CYAN; +my $CSIG = CYAN; + +if (@ARGV) { + my $code = system (@ARGV); + + if ($code < 0) { + exit 127; + } + elsif ($code > 0) { + + my $status = $code >> 8; + my $signum = $code & 127; + my $core = $code & 128; + + my %sig_idx; + @sig_idx{split /\s+/, $Config{sig_num}} = split /\s/, $Config{sig_name}; + + printf STDERR ( +<> /etc/apt/sources.list' + run_or_err "Updating APT sources" "sudo apt-get update" + apt_install ${extra_debs[@]} libmysqlclient-dev memcached firebird2.5-super firebird2.5-dev expect - run_or_err "Cloning poor man's cache from github" "git clone --depth=1 --branch=poor_mans_travis_cache https://github.com/ribasushi/travis_futzing.git $CACHE_DIR && $CACHE_DIR/reassemble" - run_or_err "Priming up the APT cache with $(echo $(ls -d $CACHE_DIR/apt_cache/*.deb))" "sudo cp $CACHE_DIR/apt_cache/*.deb /var/cache/apt/archives" + # need to stop them again, in case we installed them above (trusty) + for d in mysql postgresql ; do + run_or_err "Stopping $d" "sudo /etc/init.d/$d stop || /bin/true" + done + + + export CACHE_DIR="/tmp/poormanscache" + mkdir "$CACHE_DIR" + + # FIXME - by default db2 eats too much memory, we won't be able to test on legacy infra + # someone needs to add a minimizing configuration akin to 9367d187 + if [[ "$(free -m | grep 'Mem:' | perl -p -e '$_ = (split /\s+/, $_)[1]')" -gt 4000 ]] ; then + run_or_err "Getting DB2 from poor man's cache github" ' + wget -qO- https://github.com/poormanscache/poormanscache/archive/DB2_ExC/9.7.5_deb_x86-64.tar.gz \ + | tar -C "$CACHE_DIR" -zx' + + # the actual package is built for lucid, installs fine on both precise and trusty + manual_debs+=( "db2exc_9.7.5-0lucid0_amd64.deb" ) + fi + + run_or_err "Getting Oracle from poor man's cache github" ' + wget -qO- https://github.com/poormanscache/poormanscache/archive/OracleXE/10.2.0_deb_mixed.tar.gz \ + | tar -C "$CACHE_DIR" -zx' + manual_debs+=( "bc-multiarch-travis_1.0_all.deb" "oracle-xe_10.2.0.1-1.1_i386.deb" ) + + + # reassemble chunked pieces ( working around github's filesize limit ) + for reass in $CACHE_DIR/*/reassemble ; do /bin/bash "$reass" ; done + + run_or_err "Installing RDBMS debs manually: $( echo ${manual_debs[@]/#/$CACHE_DIR/*/*/} )" \ + "sudo dpkg -i $( echo ${manual_debs[@]/#/$CACHE_DIR/*/*/} ) || sudo bash -c 'source maint/travis-ci_scripts/common.bash && apt_install -f'" + + + # needs to happen separately and *after* db2exc, as the former shits all over /usr/include (wtf?!) + # for more info look at /opt/ibm/db2/V9.7/instance/db2iutil :: create_links() + apt_install unixodbc-dev - apt_install memcached firebird2.5-super firebird2.5-dev unixodbc-dev expect oracle-xe ### config memcached run_or_err "Starting memcached" "sudo /etc/init.d/memcached start" export DBICTEST_MEMCACHED=127.0.0.1:11211 ### config mysql - run_or_err "Creating MySQL TestDB" "mysql -e 'create database dbic_test;'" + run_or_err "Installing minimizing MySQL config" "\ + sudo bash -c 'rm /var/lib/mysql/ib*' \ + && sudo cp maint/travis-ci_scripts/configs/minimal_mysql_travis.cnf /etc/mysql/conf.d/ \ + && sudo chmod 644 /etc/mysql/conf.d/*.cnf \ + " + + run_or_err "Starting MySQL" "sudo /etc/init.d/mysql start" + run_or_err "Creating MySQL TestDB" "mysql -u root -e 'create database dbic_test;'" export DBICTEST_MYSQL_DSN='dbi:mysql:database=dbic_test;host=127.0.0.1' export DBICTEST_MYSQL_USER=root ### config pg + run_or_err "Starting PostgreSQL" "sudo /etc/init.d/postgresql start" run_or_err "Creating PostgreSQL TestDB" "psql -c 'create database dbic_test;' -U postgres" export DBICTEST_PG_DSN='dbi:Pg:database=dbic_test;host=127.0.0.1' export DBICTEST_PG_USER=postgres @@ -61,27 +159,19 @@ if [[ "$CLEANTEST" != "true" ]]; then send "\177\177\177\177yes\r" expect "Password for SYSDBA" send "123\r" - sleep 1 + sleep 2 expect eof ' # creating testdb # FIXME - this step still fails from time to time >:((( # has to do with the FB reconfiguration I suppose # for now if it fails twice - simply skip FB testing - for i in 1 2 ; do + for i in 1 2 3 ; do run_or_err "Re-configuring Firebird" " sync + sleep 5 DEBIAN_FRONTEND=text sudo expect -c '$EXPECT_FB_SCRIPT' - sleep 1 - sync - # restart the server for good measure - sudo /etc/init.d/firebird2.5-super stop || true - sleep 1 - sync - sudo /etc/init.d/firebird2.5-super start - sleep 1 - sync " if run_or_err "Creating Firebird TestDB" \ @@ -184,5 +274,25 @@ FileUsage = 1 GRANT connect,resource TO $DBICTEST_ORA_EXTRAUSER_USER; '" - export ORACLE_HOME="$CACHE_DIR/ora_instaclient/x86-64/oracle_instaclient_10.2.0.5.0" + export ORACLE_HOME="$CACHE_DIR/poormanscache-OracleXE-10.2.0_deb_mixed/ora_instaclient/x86-64/oracle_instaclient_10.2.0.5.0" + +### config db2exc + # we may have skipped installation due to low memory + if dpkg -l db2exc &>/dev/null ; then + # WTF is this world-writable? + # Strip the write bit so it doesn't trip Ubuntu's symlink-in-/tmp attack mitigation + sudo chmod -R o-w ~dasusr1/das + + export DB2_HOME=/opt/ibm/db2/V9.7 + export DBICTEST_DB2_DSN=dbi:DB2:DATABASE=dbictest + export DBICTEST_DB2_USER=db2inst1 + export DBICTEST_DB2_PASS=abc123456 + + run_or_err "Set up DB2 users" \ + "echo -e '$DBICTEST_DB2_PASS\n$DBICTEST_DB2_PASS' | sudo passwd $DBICTEST_DB2_USER" + + run_or_err "Create DB2 database" \ + "sudo -u $DBICTEST_DB2_USER -i db2 'CREATE DATABASE dbictest' && sudo -u $DBICTEST_DB2_USER -i db2 'ACTIVATE DATABASE dbictest'" + fi + fi diff --git a/maint/travis-ci_scripts/20_install.bash b/maint/travis-ci_scripts/20_install.bash index e254fb2..3a4ff7b 100755 --- a/maint/travis-ci_scripts/20_install.bash +++ b/maint/travis-ci_scripts/20_install.bash @@ -1,47 +1,62 @@ #!/bin/bash -source maint/travis-ci_scripts/common.bash if [[ -n "$SHORT_CIRCUIT_SMOKE" ]] ; then return ; fi -CPAN_MIRROR=$(echo "$PERL_CPANM_OPT" | grep -oP -- '--mirror\s+\S+' | head -n 1 | cut -d ' ' -f 2) -if ! [[ "$CPAN_MIRROR" =~ "http://" ]] ; then - echo_err "Unable to extract primary cpan mirror from PERL_CPANM_OPT - something is wrong" - echo_err "PERL_CPANM_OPT: $PERL_CPANM_OPT" - CPAN_MIRROR="http://cpan.metacpan.org/" - PERL_CPANM_OPT="$PERL_CPANM_OPT --mirror $CPAN_MIRROR" - echo_err "Using $CPAN_MIRROR for the time being" -fi +# we need a mirror that both has the standard index and a backpan version rolled +# into one, due to MDV testing +export CPAN_MIRROR="http://cpan.metacpan.org/" + +PERL_CPANM_OPT="$PERL_CPANM_OPT --mirror $CPAN_MIRROR" -export PERL_MM_USE_DEFAULT=1 PERL_MM_NONINTERACTIVE=1 PERL_AUTOINSTALL_PREFER_CPAN=1 PERLBREW_CPAN_MIRROR="$CPAN_MIRROR" HARNESS_TIMER=1 MAKEFLAGS="-j$NUMTHREADS" +# 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$VCPU_USE" # try CPAN's latest offering if requested if [[ "$DEVREL_DEPS" == "true" ]] ; then PERL_CPANM_OPT="$PERL_CPANM_OPT --dev" - # FIXME inline-upgrade cpanm, work around https://github.com/travis-ci/travis-ci/issues/1477 - cpanm_loc="$(which cpanm)" - run_or_err "Upgrading cpanm ($cpanm_loc) to latest stable" \ - "wget -q -O $cpanm_loc cpanmin.us && chmod a+x $cpanm_loc" fi # Fixup CPANM_OPT to behave more like a traditional cpan client export PERL_CPANM_OPT="--verbose --no-interactive --no-man-pages $( echo $PERL_CPANM_OPT | sed 's/--skip-satisfied//' )" 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" + if [[ "$BREWVER" =~ [A-Za-z] ]] || perl -Mversion -e "exit !!(version->new(q($BREWVER)) < 5.014)" ; then + perlbrew_jopt="$VCPU_USE" + fi + + BREWSRC="$BREWVER" + + if is_cperl; then + if [[ "$BREWVER" == "cperl-master" ]] ; then + git clone --single-branch --depth=1 --branch=master https://github.com/perl11/cperl /tmp/cperl-master + BREWSRC="/tmp/cperl-master" + else + # FFS perlbrew ( see http://wollmers-perl.blogspot.de/2015/10/install-cperl-with-perlbrew.html ) + wget -qO- https://github.com/perl11/cperl/archive/$BREWVER.tar.gz > /tmp/cperl-$BREWVER.tar.gz + BREWSRC="/tmp/cperl-$BREWVER.tar.gz" + fi + elif [[ "$BREWVER" == "schmorp_stableperl" ]] ; then + BREWSRC="http://stableperl.schmorp.de/dist/stableperl-5.22.0-1.001.tar.gz" fi run_or_err "Compiling/installing Perl $BREWVER (without testing, using ${perlbrew_jopt:-1} threads, may take up to 5 minutes)" \ - "perlbrew install --as $BREWVER --notest --noman --verbose $BREWOPTS -j${perlbrew_jopt:-1} $BREWVER" + "perlbrew install --as $BREWVER --notest --noman --verbose $BREWOPTS -j${perlbrew_jopt:-1} $BREWSRC" + + # FIXME work around https://github.com/perl11/cperl/issues/144 + # (still affecting 5.22.3) + if is_cperl && ! [[ -f ~/perl5/perlbrew/perls/$BREWVER/bin/perl ]] ; then + ln -s ~/perl5/perlbrew/perls/$BREWVER/bin/cperl ~/perl5/perlbrew/perls/$BREWVER/bin/perl + fi - # can not do 'perlbrew uss' in the run_or_err subshell above, or a $() - # furthermore `perlbrew use` returns 0 regardless of whether the perl is - # found (won't be there unless compilation suceeded, wich *ALSO* returns 0) - perlbrew use $BREWVER + # can not do 'perlbrew use' in the run_or_err subshell above, or a $() + # furthermore some versions of `perlbrew use` return 0 regardless of whether + # the perl is found (won't be there unless compilation suceeded, wich *ALSO* returns 0) + perlbrew use $BREWVER || /bin/true if [[ "$( perlbrew use | grep -oP '(?<=Currently using ).+' )" != "$BREWVER" ]] ; then echo_err "Unable to switch to $BREWVER - compilation failed...?" @@ -51,25 +66,15 @@ 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 elif [[ "$CLEANTEST" == "true" ]] && [[ "$POISON_ENV" != "true" ]] ; then + purge_sitelib +fi - echo_err "$(tstamp) Cleaning precompiled Travis-Perl" - perl -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 +if [[ "$POISON_ENV" = "true" ]] ; then + # create a perlbrew-specific local lib + perlbrew lib create travis-local + perlbrew use "$( perlbrew use | grep -oP '(?<=Currently using ).+' )@travis-local" + echo_err "POISON_ENV active - adding a local lib: $(perlbrew use)" fi # configure CPAN.pm - older versions go into an endless loop @@ -80,7 +85,88 @@ CPAN_CFG_SCRIPT=" *CPAN::FirstTime::conf_sites = sub {}; CPAN::Config->load; \$CPAN::Config->{urllist} = [qw{ $CPAN_MIRROR }]; - \$CPAN::Config->{halt_on_failure} = 1; + \$CPAN::Config->{halt_on_failure} = $( is_cperl && echo -n 0 || echo -n 1 ); CPAN::Config->commit; " run_or_err "Configuring CPAN.pm" "perl -e '$CPAN_CFG_SCRIPT'" + + +# These envvars are always set, more *maybe* below +export DBIC_SHUFFLE_UNORDERED_RESULTSETS=1 + +# bogus nonexisting DBI_* +export DBI_DSN="dbi:ODBC:server=NonexistentServerAddress" +export DBI_DRIVER="ADO" + +# some people do in fact set this - boggle!!! +# it of course won't work before 5.8.4 +if perl -M5.008004 -e 1 &>/dev/null ; then + export PERL_STRICTURES_EXTRA=1 +fi + + +# poison the environment +if [[ "$POISON_ENV" = "true" ]] ; then + + toggle_vars=( MVDT ) + + [[ "$CLEANTEST" == "true" ]] && toggle_vars+=( BREAK_CC ) + + for var in "${toggle_vars[@]}" ; do + if [[ -z "${!var}" ]] ; then + export $var=true + echo "POISON_ENV: setting $var to 'true'" + fi + done + + # look through lib, find all mentioned DBIC* ENVvars and set them to true and see if anything explodes + toggle_booleans=( $( grep -ohP '\bDBIC_[0-9_A-Z]+' -r lib/ --exclude-dir Optional | sort -u | grep -vP '^(DBIC_TRACE(_PROFILE)?|DBIC_.+_DEBUG)$' ) ) + + # some extra pollutants + toggle_booleans+=( \ + DBICTEST_ASSERT_NO_SPURIOUS_EXCEPTION_ACTION \ + DBICTEST_SQLITE_USE_FILE \ + DBICTEST_RUN_ALL_TESTS \ + DBICTEST_SQLITE_REVERSE_DEFAULT_ORDER \ + ) + + # if we have Moose - try to run everything under replicated + # FIXME - when switching to Moo kill this + if [[ "$CLEANTEST" != "true" ]] && perl -M5.008003 -e 1 &>/dev/null ; then + toggle_booleans+=( DBICTEST_VIA_REPLICATED ) + fi + + for var in "${toggle_booleans[@]}" + do + if [[ -z "${!var}" ]] ; then + export $var=1 + echo "POISON_ENV: setting $var to 1" + fi + done + + +### emulate a local::lib-like env + + # trick cpanm into executing true as shell - we just need the find+unpack + run_or_err "Downloading latest stable DBIC from CPAN" \ + "SHELL=/bin/true cpanm --look DBIx::Class" + + # move it somewhere as following cpanm will clobber it + run_or_err "Moving latest stable DBIC from CPAN to /tmp" "mv ~/.cpanm/latest-build/DBIx-Class-*/lib /tmp/stable_dbic_lib" + + export PERL5LIB="/tmp/stable_dbic_lib:$PERL5LIB" + + # perldoc -l searches $(pwd)/lib in addition to PERL5LIB etc, hence the cd / + echo_err "Latest stable DBIC (without deps) locatable via \$PERL5LIB at $(cd / && perldoc -l DBIx::Class)" +fi + +if [[ "$CLEANTEST" != "true" ]] ; then + # using SQLT if will be available + # not doing later because we will be running in a subshell + export DBICTEST_SQLT_DEPLOY=1 + +fi + +# FIXME - work around https://github.com/miyagawa/cpanminus/issues/462 +# seriously... +perl -p -i -e 's/\blocal\$self->\{notest\}=1;//' $(which cpanm) diff --git a/maint/travis-ci_scripts/30_before_script.bash b/maint/travis-ci_scripts/30_before_script.bash index a91067a..3feaa2c 100755 --- a/maint/travis-ci_scripts/30_before_script.bash +++ b/maint/travis-ci_scripts/30_before_script.bash @@ -1,55 +1,104 @@ #!/bin/bash +# 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 return ; fi -# poison the environment -if [[ "$POISON_ENV" = "true" ]] ; then +if [[ -n "$SHORT_CIRCUIT_SMOKE" ]] ; then exit 0 ; fi - # look through lib, find all mentioned ENVvars and set them - # to true and see if anything explodes - for var in $(grep -P '\$ENV\{' -r lib/ | grep -oP 'DBIC_\w+' | sort -u | grep -v DBIC_TRACE) ; do - if [[ -z "${!var}" ]] ; then - export $var=1 - fi - done +# The DEVREL_DEPS prereq-install stage won't mix with MVDT +# DEVREL wins +if [[ "$DEVREL_DEPS" == "true" ]] ; then + export MVDT="" +fi - # bogus nonexisting DBI_* - export DBI_DSN="dbi:ODBC:server=NonexistentServerAddress" - export DBI_DRIVER="ADO" +# Need a shitton of patches to run on cperl (luckily all provided) +if is_cperl ; then - # make sure tests do not rely on implicid order of returned results - export DBICTEST_SQLITE_REVERSE_DEFAULT_ORDER=1 + run_or_err "Downloading and installing cperl distroprefs" ' + wget -qO- https://github.com/rurban/distroprefs/archive/master.tar.gz |\ + tar -C $HOME/.cpan --strip-components 1 -zx distroprefs-master/prefs distroprefs-master/sources + ' - # emulate a local::lib-like env - # trick cpanm into executing true as shell - we just need the find+unpack - run_or_err "Downloading latest stable DBIC from CPAN" \ - "SHELL=/bin/true cpanm --look DBIx::Class" + # Argh -DFORTIFY_INC!!! + # FIXME - remove when M::I is gone + export PERL5LIB="$PERL5LIB:." - export PERL5LIB="$( ls -d ~/.cpanm/latest-build/DBIx-Class-*/lib | tail -n1 ):$PERL5LIB" + # Also need to have YAML in place, otherwise the distroprefs are not readable + # work around https://github.com/perl11/cperl/issues/155#issuecomment-224862978 + perl -MYAML -e1 &>/dev/null || installdeps YAML - # perldoc -l searches $(pwd)/lib in addition to PERL5LIB etc, hence the cd / - echo_err "Latest stable DBIC (without deps) locatable via \$PERL5LIB at $(cd / && perldoc -l DBIx::Class)" +fi + + +# announce what are we running +echo_err "$(ci_vm_state_text)" + + +# FIXME - this is a kludge in place of proper MVDT testing. For the time +# being simply use the minimum versions of our DBI/DBDstack, to avoid +# fuckups like 0.08260 (went unnoticed for 5 months) +if [[ "$MVDT" == "true" ]] ; then - # FIXME - this is a kludge in place of proper MDV testing. For the time - # being simply use the minimum versions of our DBI/DBDstack, to avoid - # fuckups like 0.08260 (went unnoticed for 5 months) - # # use url-spec for DBI due to https://github.com/miyagawa/cpanminus/issues/328 - if perl -M5.013003 -e1 &>/dev/null ; then + if [[ "$CLEANTEST" != "true" ]] || perl -M5.013003 -e1 &>/dev/null ; then + # the fulltest may re-upgrade DBI, be conservative only on cleantests # earlier DBI will not compile without PERL_POLLUTE which was gone in 5.14 parallel_installdeps_notest T/TI/TIMB/DBI-1.614.tar.gz + + # 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 else parallel_installdeps_notest T/TI/TIMB/DBI-1.57.tar.gz + + # 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 + # reverse the logic from above for this (low on full, higher on clean) if [[ "$CLEANTEST" = "true" ]]; then parallel_installdeps_notest DBD::SQLite@1.37 else parallel_installdeps_notest DBD::SQLite@1.29 fi +fi + +# +# try minimal fully tested installs *without* a compiler (with some exceptions of course) +if [[ "$BREAK_CC" == "true" ]] ; then + [[ "$CLEANTEST" != "true" ]] && echo_err "Breaking the compiler without CLEANTEST makes no sense" && exit 1 + + # FIXME - working around RT#74707, https://metacpan.org/source/DOY/Package-Stash-0.37/Makefile.PL#L112-122 + # + # DEVREL_DEPS means our installer is cpanm, which will respect failures + # and the like, so stuff soft-failing (failed deps that are not in fact + # needed) will not fly. Add *EVEN MORE* stuff that needs a compiler + # + # FIXME - the PathTools 3.47 is to work around https://rt.cpan.org/Ticket/Display.html?id=107392 + # + installdeps Sub::Name Clone Package::Stash::XS \ + $( perl -MFile::Spec\ 3.26 -e1 &>/dev/null || echo "File::Path File::Spec" ) \ + $( perl -MList::Util\ 1.16 -e1 &>/dev/null || echo "List::Util" ) \ + $( [[ "$DEVREL_DEPS" == "true" ]] && ( perl -MFile::Spec\ 3.13 -e1 &>/dev/null || echo "S/SM/SMUELLER/PathTools-3.47.tar.gz" ) ) \ + $( perl -MDBI -e1 &>/dev/null || echo "DBI" ) \ + $( perl -MDBD::SQLite -e1 &>/dev/null || echo "DBD::SQLite" ) + + mkdir -p "$HOME/bin" # this is already in $PATH, just doesn't exist + run_or_err "Linking ~/bin/cc to /bin/false - thus essentially BREAKING the C compiler" \ + "ln -s /bin/false $HOME/bin/cc" + + # FIXME: working around RT#113682, and some other unfiled bugs + installdeps Module::Build Devel::GlobalDestruction Class::Accessor::Grouped + + run_or_err "Linking ~/bin/cc to /bin/true - BREAKING the C compiler even harder" \ + "ln -fs /bin/true $HOME/bin/cc" fi if [[ "$CLEANTEST" = "true" ]]; then @@ -58,7 +107,7 @@ if [[ "$CLEANTEST" = "true" ]]; then # the point is to have a *really* clean perl (the ones # we build are guaranteed to be clean, without side # effects from travis preinstalls) - + # # trick cpanm into executing true as shell - we just need the find+unpack [[ -d ~/.cpanm/latest-build/DBIx-Class-*/inc ]] || run_or_err "Downloading latest stable DBIC inc/ from CPAN" \ "SHELL=/bin/true cpanm --look DBIx::Class" @@ -73,166 +122,100 @@ if [[ "$CLEANTEST" = "true" ]]; then # So instead we still use our stock (possibly old) CPAN, and add some # handholding - if [[ "$DEVREL_DEPS" == "true" ]] ; then - # Many dists still do not pass tests under tb1.5 properly (and it itself - # does not even install on things like 5.10). Install the *stable-dev* - # latest T::B here, so that it will not show up as a dependency, and - # hence it will not get installed a second time as an unsatisfied dep - # under cpanm --dev - # - # We are also not "quite ready" for SQLA 1.99, do not consider it - # - installdeps 'Test::Builder~<1.005' 'SQL::Abstract~<1.99' - + if [[ "$DEVREL_DEPS" = "true" ]] ; then + # nothing for now + /bin/true elif ! 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 # we will be running all dbic tests - preinstall lots of stuff, run basic tests - # using SQLT and set up whatever databases necessary - export DBICTEST_SQLT_DEPLOY=1 - - # FIXME - need new TB1.5 devrel - # if we run under --dev install latest github of TB1.5 first - # (unreleased workaround for precedence warnings) - if [[ "$DEVREL_DEPS" == "true" ]] ; then - parallel_installdeps_notest git://github.com/nthykier/test-more.git@fix-return-precedence-issue - fi # do the preinstall in several passes to minimize amount of cross-deps installing # multiple times, and to avoid module re-architecture breaking another install - # (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) + # (e.g. once Carp is upgraded there's no more Carp::Heavy) # - 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 Test::Exception Encode::Locale Test::Fatal + parallel_installdeps_notest Test::Exception Encode::Locale Test::Fatal Module::Runtime 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 JSON::XS DateTime::Format::Builder Class::Accessor::Grouped Package::Variant - parallel_installdeps_notest 'SQL::Abstract~<1.99' Moose Module::Install JSON SQL::Translator File::Which + parallel_installdeps_notest YAML LWP Class::Trigger DateTime::Format::Builder Class::Accessor::Grouped Package::Variant + parallel_installdeps_notest SQL::Abstract Moose Module::Install@1.15 JSON SQL::Translator File::Which Class::DBI::Plugin git://github.com/dbsrgits/perl-pperl.git - if [[ -n "DBICTEST_FIREBIRD_INTERBASE_DSN" ]] ; then - # 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): - # https://github.com/pilcrow/perl-dbd-interbase + # 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): + # https://github.com/pilcrow/perl-dbd-interbase + if [[ -n "$DBICTEST_FIREBIRD_INTERBASE_DSN" ]] ; then parallel_installdeps_notest git://github.com/dbsrgits/perl-dbd-interbase.git fi + # SCGI does not install under < 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) + if perl -M5.008008 -e 1 &>/dev/null ; then + MAKEFLAGS="" bash -c "parallel_installdeps_notest git://github.com/dbsrgits/cgi-speedycgi.git" + fi fi -# generate the makefile which will have different deps depending on -# the runmode and envvars set above -run_or_err "Configure on current branch" "perl Makefile.PL" # install (remaining) dependencies, sometimes with a gentle push if [[ "$CLEANTEST" = "true" ]]; then - # we may need to prepend some stuff to that list - HARD_DEPS="$(echo $(make listdeps))" - -##### TEMPORARY WORKAROUNDS needed in case we will be using CPAN.pm - if [[ "$DEVREL_DEPS" != "true" ]] && ! CPAN_is_sane ; then - # combat dzillirium on harness-wide level, otherwise breakage happens weekly - echo_err "$(tstamp) Ancient CPAN.pm: engaging TAP::Harness::IgnoreNonessentialDzilAutogeneratedTests during dep install" - perl -MTAP::Harness\ 3.18 -e1 &>/dev/null || run_or_err "Upgrading TAP::Harness for HARNESS_SUBCLASS support" "cpan TAP::Harness" - export PERL5LIB="$(pwd)/maint/travis-ci_scripts/lib:$PERL5LIB" - export HARNESS_SUBCLASS="TAP::Harness::IgnoreNonessentialDzilAutogeneratedTests" - # sanity check, T::H does not report sensible errors when the subclass fails to load - perl -MTAP::Harness::IgnoreNonessentialDzilAutogeneratedTests -e1 - - # 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" - - # FIXME - # parent is temporary due to Carp https://rt.cpan.org/Ticket/Display.html?id=88494 - HARD_DEPS="parent $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 - installdeps $HARD_DEPS + run_or_err "Configure on current branch" "perl Makefile.PL" + + # 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="$(make listalldeps | sort -R)" + + else + + HARD_DEPS="$(make listdeps | sort -R)" + +##### TEMPORARY WORKAROUNDS needed in case we will be using a fucked CPAN.pm + if ! CPAN_is_sane ; then + + # DBD::SQLite reasonably wants DBI at config time + perl -MDBI -e1 &>/dev/null || HARD_DEPS="DBI $HARD_DEPS" -### FIXME in case we set it earlier in a workaround - if [[ -n "$HARNESS_SUBCLASS" ]] ; then - - INSTALLDEPS_SKIPPED_TESTLIST=$(perl -0777 -e ' -my $curmod_re = qr{ -^ - (?: - \QBuilding and testing\E - | - [\x20\t]* CPAN\.pm: [^\n]*? (?i:build)\S* - ) - - [\x20\t]+ (\S+) -$}mx; - -my $curskip_re = qr{^ === \x20 \QSkipping nonessential autogenerated tests: \E([^\n]+) }mx; - -my (undef, @chunks) = (split qr/$curmod_re/, <>); -while (@chunks) { - my ($mod, $log) = splice @chunks, 0, 2; - print "!!! Skipped nonessential tests while installing $mod:\n\t$1\n" - if $log =~ $curskip_re; -} -' <<< "$LASTOUT") - - if [[ -n "$INSTALLDEPS_SKIPPED_TESTLIST" ]] ; then - POSTMORTEM="$POSTMORTEM$( - echo - echo "The following non-essential tests were skipped during deps installation" - echo "=============================================================" - echo "$INSTALLDEPS_SKIPPED_TESTLIST" - echo "=============================================================" - echo - )" fi - unset HARNESS_SUBCLASS +##### END TEMPORARY WORKAROUNDS fi + installdeps $HARD_DEPS + + run_or_err "Re-configure" "perl Makefile.PL" + else - # listalldeps is deliberate - will upgrade everything it can find - # we exclude SQLA specifically, since we do not want to pull - # in 1.99_xx on bleadcpan runs - deplist="$(make listalldeps | grep -vP '^(SQL::Abstract)$')" + run_or_err "Configure on current branch with --with-optdeps" "perl Makefile.PL --with-optdeps" - # assume MDV on POISON_ENV, do not touch DBI/SQLite - if [[ "$POISON_ENV" = "true" ]] ; then - deplist="$(grep -vP '^(DBI|DBD::SQLite)$' <<< "$deplist")" + # FIXME - evil evil work around for https://github.com/Manwar/Test-Strict/issues/17 + if perl -M5.025 -e1 &>/dev/null; then + mkdir -p "$( perl -MConfig -e 'print $Config{sitelib}' )/Devel" + cat < "$( perl -MConfig -e 'print $Config{sitelib}' )/Devel/Cover.pm" +package Devel::Cover; +our \$VERSION = 0.43; +1; +MyDevelCover fi - parallel_installdeps_notest "$deplist" + # if we are smoking devrels - make sure we upgrade everything we know about + if [[ "$DEVREL_DEPS" == "true" ]] ; then + parallel_installdeps_notest "$(make listalldeps | sort -R)" + else + parallel_installdeps_notest "$(make listdeps | sort -R)" + fi + + run_or_err "Re-configure with --with-optdeps" "perl Makefile.PL --with-optdeps" fi echo_err "$(tstamp) Dependency installation finished" -# this will display list of available versions -perl Makefile.PL # make sure we got everything we need if [[ -n "$(make listdeps)" ]] ; then @@ -244,36 +227,12 @@ if [[ -n "$(make listdeps)" ]] ; then exit 1 fi -# check that our MDV somewhat works -if [[ "$POISON_ENV" = "true" ]] && ( perl -MDBD::SQLite\ 1.38 -e1 || perl -MDBI\ 1.615 -e1 ) &>/dev/null ; then +# check that our MVDT somewhat works +if [[ "$MVDT" == "true" ]] && ( perl -MDBD::SQLite\ 1.38 -e1 || perl -MDBI\ 1.615 -e1 ) &>/dev/null ; then echo_err "Something went wrong - higher versions of DBI and/or DBD::SQLite than we expected" exit 1 fi - -# announce what are we running echo_err " ===================== DEPENDENCY CONFIGURATION COMPLETE ===================== -$(tstamp) Configuration phase seems to have taken $(date -ud "@$SECONDS" '+%H:%M:%S') (@$SECONDS) - -= CPUinfo -$(perl -0777 -p -e 's/.+\n\n(?!\z)//s' < /proc/cpuinfo) - -= Meminfo -$(free -m -t) - -= Kernel info -$(uname -a) - -= Network Configuration -$(ip addr) - -= Network Sockets Status -$(sudo netstat -an46p | grep -Pv '\s(CLOSING|(FIN|TIME|CLOSE)_WAIT.?|LAST_ACK)\s') - -= Environment -$(env | grep -P 'TEST|HARNESS|MAKE|TRAVIS|PERL|DBIC' | LC_ALL=C sort | cat -v) - -= Perl in use -$(perl -V) -=============================================================================" +$(tstamp) Configuration phase seems to have taken $(date -ud "@$SECONDS" '+%H:%M:%S') (@$SECONDS)" diff --git a/maint/travis-ci_scripts/40_script.bash b/maint/travis-ci_scripts/40_script.bash index 8cb9048..7887684 100755 --- a/maint/travis-ci_scripts/40_script.bash +++ b/maint/travis-ci_scripts/40_script.bash @@ -1,10 +1,21 @@ #!/bin/bash +# 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 return ; fi + +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 + # if we run under docker (! have_sudo) the logic below won't work + # it seems as if ulimit acts globally, across the entire OS + # and is thus not served properly by a localised `ps xH` + if [[ "$VCPU_USE" == 1 ]] && have_sudo ; then + ulim=$(( ( $(ps xH | wc -l) - 3 ) + 4 )) # (real count excluding header + ps + wc) + space for ( make + tee + harness + ) + echo_err "$(tstamp) Setting process/thread limit to $ulim" + ulimit -u $ulim + sleep 5 # needed to settle things down a bit + fi make test 2> >(tee "$TEST_STDERR_LOG") } @@ -14,11 +25,11 @@ if [[ "$CLEANTEST" = "true" ]] ; then run_or_err "Prepare blib" "make pure_all" run_harness_tests else - PROVECMD="prove -lrswj$NUMTHREADS xt t" + PROVECMD="prove -lrswTj$VCPU_USE xt t" - # FIXME - temporary, until Package::Stash is fixed - if perl -M5.010 -e 1 &>/dev/null ; then - PROVECMD="$PROVECMD -T" + # List every single SKIP/TODO when they are visible + if [[ "$VCPU_USE" == 1 ]] ; then + PROVECMD="$PROVECMD --directives" fi echo_err "$(tstamp) running tests with \`$PROVECMD\`" @@ -26,7 +37,12 @@ else fi TEST_T1=$SECONDS -if [[ -z "$DBICTRACE" ]] && [[ -z "$POISON_ENV" ]] && [[ -s "$TEST_STDERR_LOG" ]] ; then +if \ + [[ -z "$DBIC_TRACE" ]] \ +&& [[ -z "$DBIC_MULTICREATE_DEBUG" ]] \ +&& [[ -z "$DBICTEST_DEBUG_CONCURRENCY_LOCKS" ]] \ +&& [[ -z "$DBICTEST_VERSION_WARNS_INDISCRIMINATELY" ]] \ +&& [[ -s "$TEST_STDERR_LOG" ]] ; then STDERR_LOG_SIZE=$(wc -l < "$TEST_STDERR_LOG") # prepend STDERR log @@ -47,6 +63,6 @@ echo "${POSTMORTEM:- \o/ No notable smoke run issues \o/ }" echo echo "$(tstamp) Testing took a total of $(( $TEST_T1 - $TEST_T0 ))s" if [[ -n "$INSTALLDEPS_OUT" ]] ; then - echo "$(tstamp) Full dep install log at $(/usr/bin/nopaste -q -s Shadowcat -d DepInstall <<< "$INSTALLDEPS_OUT")" + echo "$(tstamp) Full dep install log at $(/usr/bin/perl /usr/bin/nopaste -q -s Shadowcat -d DepInstall <<< "$INSTALLDEPS_OUT")" fi echo diff --git a/maint/travis-ci_scripts/50_after_failure.bash b/maint/travis-ci_scripts/50_after_failure.bash index 4935763..ba92421 100755 --- a/maint/travis-ci_scripts/50_after_failure.bash +++ b/maint/travis-ci_scripts/50_after_failure.bash @@ -1,11 +1,11 @@ #!/bin/bash -# !!! Nothing here will be executed !!! -# The source-line calling this script is commented out in .travis.yml - +# 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 return ; fi -echo_err "Nothing to do" +if [[ -n "$SHORT_CIRCUIT_SMOKE" ]] ; then exit 0 ; fi -return 0 +if [[ "$(dmesg)" =~ $( echo "\\bOOM\\b" ) ]] ; then + echo_err "=== dmesg ringbuffer" + echo_err "$(dmesg)" +fi diff --git a/maint/travis-ci_scripts/50_after_success.bash b/maint/travis-ci_scripts/50_after_success.bash index c8d2bac..102291d 100755 --- a/maint/travis-ci_scripts/50_after_success.bash +++ b/maint/travis-ci_scripts/50_after_success.bash @@ -1,15 +1,11 @@ #!/bin/bash +# !!! Nothing here will be executed !!! +# The line calling this script is commented out in .travis.yml + +# 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 return ; fi - -if [[ "$CLEANTEST" != "true" ]] ; then - parallel_installdeps_notest $(perl -Ilib -MDBIx::Class -e 'print join " ", keys %{DBIx::Class::Optional::Dependencies->req_list_for("dist_dir")}') - run_or_err "Attempt to build a dist with all prereqs present" "make dist" - 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"' -fi + +if [[ -n "$SHORT_CIRCUIT_SMOKE" ]] ; then exit 0 ; fi + +echo_err "Nothing to do" diff --git a/maint/travis-ci_scripts/60_after_script.bash b/maint/travis-ci_scripts/60_after_script.bash index 4935763..102291d 100755 --- a/maint/travis-ci_scripts/60_after_script.bash +++ b/maint/travis-ci_scripts/60_after_script.bash @@ -1,11 +1,11 @@ #!/bin/bash # !!! Nothing here will be executed !!! -# The source-line calling this script is commented out in .travis.yml +# The line calling this script is commented out in .travis.yml +# 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 return ; fi -echo_err "Nothing to do" +if [[ -n "$SHORT_CIRCUIT_SMOKE" ]] ; then exit 0 ; fi -return 0 +echo_err "Nothing to do" diff --git a/maint/travis-ci_scripts/common.bash b/maint/travis-ci_scripts/common.bash index 7df71d1..07c6e70 100755 --- a/maint/travis-ci_scripts/common.bash +++ b/maint/travis-ci_scripts/common.bash @@ -1,9 +1,10 @@ #!/bin/bash +# "autodie" set -e TEST_STDERR_LOG=/tmp/dbictest.stderr -TIMEOUT_CMD="/usr/bin/timeout --kill-after=9.5m --signal=TERM 9m" +TIMEOUT_CMD="/usr/bin/timeout --kill-after=16m --signal=TERM 15m" echo_err() { echo "$@" 1>&2 ; } @@ -14,22 +15,79 @@ fi tstamp() { echo -n "[$(date '+%H:%M:%S')]" ; } +CPAN_is_sane() { perl -MCPAN\ 1.94_56 -e 1 &>/dev/null ; } + +CPAN_supports_BUILDPL() { perl -MCPAN\ 1.9205 -e1 &>/dev/null; } + +have_sudo() { sudo /bin/true &>/dev/null ; } + +is_cperl() { [[ "$BREWVER" =~ $( echo -n "^cperl-" ) ]] ; } + +ci_vm_state_text() { + echo " +========================== CI System information ============================ + += CPUinfo +$(perl -0777 -p -e 's/.+\n\n(?!\z)//s' < /proc/cpuinfo) + += Meminfo +$(free -m -t) + += Diskinfo +$(df -h) + +$(mount | grep '^/') + += Kernel info +$(uname -a) + += Network Configuration +$(ip addr) + += Network Sockets Status +$( (sudo netstat -an46p || netstat -an46p) | grep -Pv '\s(CLOSING|(FIN|TIME|CLOSE)_WAIT.?|LAST_ACK)\s') + += Processlist +$(ps fuxa) + += Environment +$(env | grep -P 'TEST|HARNESS|MAKE|TRAVIS|PERL|DBIC|PATH|SHELL' | LC_ALL=C sort | cat -v) + += Perl in use +$(perl -V) +=============================================================================" +} + run_or_err() { echo_err -n "$(tstamp) $1 ... " + LASTCMD="$2" LASTEXIT=0 START_TIME=$SECONDS - # the tee is a handy debugging tool when stumpage is exceedingly strong - #LASTOUT=$( bash -c "$2" 2>&1 | tee /dev/stderr) || LASTEXIT=$? - LASTOUT=$( bash -c "$2" 2>&1 ) || LASTEXIT=$? + + PRMETER_PIDFILE="$(tempfile)_$SECONDS" + # the double bash is to hide the job control messages + bash -c "bash -c 'echo \$\$ >> $PRMETER_PIDFILE; while true; do sleep 10; echo -n \"\${SECONDS}s ... \"; done' &" + + LASTOUT=$( eval "$2" 2>&1 ) || LASTEXIT=$? + + # stop progress meter + for p in $(cat "$PRMETER_PIDFILE"); do kill $p ; done + DELTA_TIME=$(( $SECONDS - $START_TIME )) if [[ "$LASTEXIT" != "0" ]] ; then - echo_err "FAILED !!! (after ${DELTA_TIME}s)" - echo_err "Command executed:" - echo_err "$2" - echo_err "STDOUT+STDERR:" - echo_err "$LASTOUT" + if [[ -z "$3" ]] ; then + echo_err "FAILED !!! (after ${DELTA_TIME}s)" + echo_err "Command executed:" + echo_err "$LASTCMD" + echo_err "STDOUT+STDERR:" + echo_err "$LASTOUT" + if [[ "$(dmesg)" =~ $( echo "\\bOOM\\b" ) ]] ; then + echo_err "=== dmesg ringbuffer" + echo_err "$(dmesg)" + fi + fi return $LASTEXIT else @@ -41,10 +99,7 @@ apt_install() { # flatten pkgs="$@" - # Need to do this at every step, the sources list may very well have changed - run_or_err "Updating APT available package list" "sudo apt-get update" - - run_or_err "Installing Debian APT packages: $pkgs" "sudo apt-get install --allow-unauthenticated --no-install-recommends -y $pkgs" + run_or_err "Installing APT packages: $pkgs" "sudo apt-get install --allow-unauthenticated --no-install-recommends -y $pkgs" } extract_prereqs() { @@ -58,7 +113,7 @@ extract_prereqs() { || LASTEXIT=$? OUT=${COMBINED_OUT#*!!!STDERRSTDOUTSEPARATOR!!!} - ERR=$(grep -v " is up to date." <<< "${COMBINED_OUT%!!!STDERRSTDOUTSEPARATOR!!!*}") + ERR=${COMBINED_OUT%!!!STDERRSTDOUTSEPARATOR!!!*} if [[ "$LASTEXIT" != "0" ]] ; then echo_err "Error occured (exit code $LASTEXIT) retrieving dependencies of $@:" @@ -67,8 +122,14 @@ extract_prereqs() { exit 1 fi - # throw away warnings, ascii art, convert to modnames - PQ=$(perl -p -e 's/^\!.*//; s/^[^a-z]+//i; s/\-[^\-]+$/ /; s/\-/::/g' <<< "$OUT") + # throw away warnings, up-to-date diag, ascii art, convert to modnames + PQ=$(perl -p -e ' + s/^.*?is up to date.*$//; + s/^\!.*//; + s/^[^a-z]+//i; + s/\-[^\-]+$/ /; # strip version part + s/\-/::/g + ' <<< "$OUT") # throw away what was in $@ for m in "$@" ; do @@ -82,8 +143,10 @@ extract_prereqs() { parallel_installdeps_notest() { if [[ -z "$@" ]] ; then return; fi + is_cperl && echo_err "cpanminus is not yet usable on cperl" && exit 1 + # one module spec per line - MODLIST="$(printf '%s\n' "$@")" + MODLIST="$(printf '%s\n' "$@" | sort -R)" # We want to trap the output of each process and serially append them to # each other as opposed to just dumping a jumbled up mass-log that would @@ -106,55 +169,34 @@ parallel_installdeps_notest() { run_or_err "Installing (without testing) $(echo $MODLIST)" \ "echo \\ \"$MODLIST\" \\ - | xargs -d '\\n' -n 1 -P $NUMTHREADS bash -c \\ - 'OUT=\$($TIMEOUT_CMD cpanm --notest \"\$@\" 2>&1 ) || (LASTEXIT=\$?; echo \"\$OUT\"; exit \$LASTEXIT)' \\ + | 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' " } +export -f parallel_installdeps_notest run_or_err echo_err tstamp is_cperl have_sudo CPAN_is_sane CPAN_supports_BUILDPL + installdeps() { if [[ -z "$@" ]] ; then return; fi - echo_err "$(tstamp) Processing dependencies: $@" + MODLIST=$(printf "%q " "$@" | perl -pe 's/^\s+|\s+$//g') local -x HARNESS_OPTIONS - HARNESS_OPTIONS="j$NUMTHREADS" + HARNESS_OPTIONS="j$VCPU_USE" - echo_err -n "Attempting install of $# modules under parallel ($HARNESS_OPTIONS) testing ... " + 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/perl /usr/bin/nopaste -q -s Shadowcat -d "Parallel testfail" <<< "$LASTOUT")" + echo "$errlog" - LASTEXIT=0 - START_TIME=$SECONDS - LASTOUT=$( _dep_inst_with_test "$@" ) || LASTEXIT=$? - DELTA_TIME=$(( $SECONDS - $START_TIME )) - - if [[ "$LASTEXIT" = "0" ]] ; then - echo_err "done (took ${DELTA_TIME}s)" - else - local errlog="after ${DELTA_TIME}s Exit:$LASTEXIT Log:$(/usr/bin/nopaste -q -s Shadowcat -d "Parallel testfail" <<< "$LASTOUT")" - echo_err -n "failed ($errlog) retrying with sequential testing ... " POSTMORTEM="$POSTMORTEM$( echo - echo "Depinstall under $HARNESS_OPTIONS parallel testing failed $errlog" - echo "=============================================================" - echo "Attempted installation of: $@" - echo "=============================================================" + echo "Depinstall of $MODLIST under $HARNESS_OPTIONS parallel testing $errlog" )" HARNESS_OPTIONS="" - LASTEXIT=0 - START_TIME=$SECONDS - LASTOUT=$( _dep_inst_with_test "$@" ) || LASTEXIT=$? - DELTA_TIME=$(( $SECONDS - $START_TIME )) - - if [[ "$LASTEXIT" = "0" ]] ; then - echo_err "done (took ${DELTA_TIME}s)" - else - echo_err "FAILED !!! (after ${DELTA_TIME}s)" - echo_err "STDOUT+STDERR:" - echo_err "$LASTOUT" - exit 1 - fi + run_or_err "Retrying same $# modules without parallel testing" "_dep_inst_with_test $MODLIST" fi INSTALLDEPS_OUT="${INSTALLDEPS_OUT}${LASTOUT}" @@ -162,24 +204,64 @@ installdeps() { _dep_inst_with_test() { if [[ "$DEVREL_DEPS" == "true" ]] ; then + is_cperl && echo_err "cpanminus is not yet usable on cperl" && exit 1 + # --dev is already part of CPANM_OPT - $TIMEOUT_CMD cpanm "$@" 2>&1 + LASTCMD="$TIMEOUT_CMD cpanm $@" + $LASTCMD 2>&1 || return 1 else - $TIMEOUT_CMD cpan "$@" 2>&1 + LASTCMD="$TIMEOUT_CMD cpan $@" + $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] ); -$mod = q{List::Util} if $mod eq q{Scalar::List::Utils}; +# map some install-names to a module/version combo +# serves both as a grandfathered title-less tarball, and +# as a minimum version check for upgraded core modules +my $eval_map = { -eval qq{require($mod)} or ( print $@ and exit 1) + # this is temporary, will need something more robust down the road + # (perhaps by then Module::CoreList will be dep-free) + "Module::Build" => { ver => "0.4214" }, + "podlators" => { mod => "Pod::Man", ver => "2.17" }, + + "File::Spec" => { ver => "3.47" }, + "Cwd" => { ver => "3.47" }, + + "List::Util" => { ver => "1.42" }, + "Scalar::Util" => { ver => "1.42" }, + "Scalar::List::Utils" => { mod => "List::Util", ver => "1.42" }, +}; + +my $m = $eval_map->{$mod}{mod} || $mod; + +eval( + "require $m" + + . + + ($eval_map->{$mod}{ver} + ? "; $m->VERSION(\$eval_map->{\$mod}{ver}) " + : "" + ) + + . + + "; 1" +) + or +( print $@ and exit 1) ' "$m" 2> /dev/null ; then echo -e "$m installation seems to have failed" @@ -189,6 +271,23 @@ eval qq{require($mod)} or ( print $@ and exit 1) fi } -CPAN_is_sane() { perl -MCPAN\ 1.94_56 -e 1 &>/dev/null ; } - -CPAN_supports_BUILDPL() { perl -MCPAN\ 1.9205 -e1 &>/dev/null; } +# 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 ) + ' + fi +} diff --git a/maint/travis-ci_scripts/configs/minimal_mysql_travis.cnf b/maint/travis-ci_scripts/configs/minimal_mysql_travis.cnf new file mode 100644 index 0000000..7fcfa8e --- /dev/null +++ b/maint/travis-ci_scripts/configs/minimal_mysql_travis.cnf @@ -0,0 +1,44 @@ +[mysqld] + +max_connections = 10 + +thread_cache_size = 0 +thread_stack = 128K + +# mysql >= 5.5.16 +#thread_pool_size = 1 + +net_buffer_length = 4K +read_buffer_size = 32K +join_buffer_size = 128K +sort_buffer_size = 128K +bulk_insert_buffer_size = 0 + +table_definition_cache = 256 +performance_schema = 0 + +query_cache_type = 0 +query_cache_size = 0 +query_cache_limit = 16K + +myisam_sort_buffer_size = 16K +tmp_table_size = 1M +key_buffer_size = 64K + +innodb_data_file_path = ibdata1:10M:autoextend +innodb_autoextend_increment = 1 +innodb_buffer_pool_size = 512K + +innodb_stats_on_metadata = 0 +innodb_file_per_table = 0 + +innodb_log_file_size = 1M +innodb_log_buffer_size = 512K +innodb_buffer_pool_size = 512K + +innodb_use_sys_malloc = 0 +innodb_additional_mem_pool_size = 256K +innodb_flush_method = O_DIRECT + +innodb_read_io_threads = 1 +innodb_write_io_threads = 1 diff --git a/maint/travis-ci_scripts/lib/TAP/Harness/IgnoreNonessentialDzilAutogeneratedTests.pm b/maint/travis-ci_scripts/lib/TAP/Harness/IgnoreNonessentialDzilAutogeneratedTests.pm deleted file mode 100644 index 7f01716..0000000 --- a/maint/travis-ci_scripts/lib/TAP/Harness/IgnoreNonessentialDzilAutogeneratedTests.pm +++ /dev/null @@ -1,93 +0,0 @@ -package TAP::Harness::IgnoreNonessentialDzilAutogeneratedTests; - -use warnings; -use strict; - -use base 'TAP::Harness'; -use File::Spec (); -use IPC::Open3 'open3'; -use File::Temp (); -use List::Util 'first'; - -my $frivolous_test_map = { -# Test based on the extremely dep-heavy, *prone to failures* Test::CheckDeps -# - qr|^t/00-check-deps.t$| => [ - qr|^\Q# this test was generated with Dist::Zilla::Plugin::Test::CheckDeps|m, - - # older non-annotated versions - qr|use \s+ Test::CheckDeps .*? ^\Qcheck_dependencies('suggests')\E .*? \QBAIL_OUT("Missing dependencies") if !Test::More->builder->is_passing|smx, - ], - -# "does everything compile" tests are useless by definition - this is what the -# rest of the test suite is for -# - qr|^t/00-compile.t$| => [ - qr|^\Q# this test was generated with Dist::Zilla::Plugin::Test::Compile|m, - ], - -# The report prereq test managed to become fatal as well -# - qr|^t/00-report-prereqs.t$| => [ - qr|^\Q# This test was generated by Dist::Zilla::Plugin::Test::ReportPrereqs|m, - ], - -# Just future-proof the thing, catch anything autogened by dzil for a bit - qr|^t/00-| => [ - qr|^\Q# This test was generated by Dist::Zilla::|m, - ] -}; - -sub aggregate_tests { - my ($self, $aggregate, @all_tests) = @_; - - my ($run_tests, $skip_tests); - - TESTFILE: - for (@all_tests) { - my $fn = File::Spec::Unix->catpath( File::Spec->splitpath( $_ ) ); - - if (my $REs = $frivolous_test_map->{ - (first { $fn =~ $_ } keys %$frivolous_test_map ) || '' - }) { - my $slurptest = do { local (@ARGV, $/) = $fn; <> }; - $slurptest =~ $_ and push @$skip_tests, $fn and next TESTFILE for @$REs; - } - - push @$run_tests, $fn; - } - - if ($skip_tests) { - - for my $tfn (@$skip_tests) { - - (my $tfn_flattened = $tfn) =~ s|/|_|g; - - my $log_file = File::Temp->new( - DIR => '/tmp', - TEMPLATE => "AutoGenTest_${tfn_flattened}_XXXXX", - SUFFIX => '.txt', - ); - - # FIXME I have no idea why the fileno dance is necessary - will investigate later - # All I know is that if I pass in just $log_file - open3 ignores it >:( - my $pid = open3(undef, '>&'.fileno($log_file), undef, $^X, qw(-I blib -I arch/lib), $tfn ); - waitpid ($pid, 0); - my $ex = $?; - - if ($ex) { - # use qx as opposed to another open3 until I figure out the above - close $log_file or die "Unable to close $log_file: $!"; - chomp( my $url = `/usr/bin/nopaste -q -s Shadowcat -d $log_file < $log_file` ); - - $tfn .= "[would NOT have passed: $ex / $url]"; - } - } - - print STDERR "=== Skipping nonessential autogenerated tests: @$skip_tests\n"; - } - - return $self->SUPER::aggregate_tests($aggregate, @$run_tests); -} - -1; diff --git a/t/storage/quote_names.t b/t/storage/quote_names.t index 6492f25..1880e0e 100644 --- a/t/storage/quote_names.t +++ b/t/storage/quote_names.t @@ -128,7 +128,11 @@ for my $db (sort { "$db name_sep with quote_names => 1 is $name_sep_text"; # if something was produced - it better be quoted - if ( my $ddl = try { $schema->deployment_statements } ) { + if ( + ! grep { $db eq $_ } qw( SYBASE DB2 ) + and + my $ddl = try { $schema->deployment_statements } + ) { my $quoted_artist = $schema->storage->sql_maker->_quote('artist');