From: Peter Rabbitson Date: Mon, 23 Sep 2013 11:16:39 +0000 (+0200) Subject: Engage nuclear option of travis testing X-Git-Tag: v0.08260~141 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=f207111d67e64351cbae6f9c8c092735c681df1d;p=dbsrgits%2FDBIx-Class.git Engage nuclear option of travis testing For the record - I am not happy about having to make this commit. However the reality is that for every basic toolchain module I fix, another two are broken by dzil-addicted (though well meaning) folks. Since this essentially paralyzes any useful work, resort to simply ignoring some of the meaningless tests that are autopopulated by ill-designed dzil author bundles. This allows to revert 655d80dd, 72cd4007, and generally streamline the set of workarounds A preemptive note for anyone who is concerned that I am wasting precious tuits on a dubious goal. Please realize that one of the corner stones of my personal desire to participate in OSS comes from disdain of forced obsolescence (i.e. one shall upgrade each and every year because the author feels like it). If I can not guarantee my software performs correctly on old but usable versions of our beloved VM - a massive portion of the very reason I "keep playing" goes away entirely. With that gone the world beyond OSS suddenly becomes exceedingly more appealing, at least much more appealing as opposed to pushing features into a library unusable by most real-world production environments. Additionally whether I or anyone else has encountered users benefitting from my efforts is not relevant - the DarkPan universe is vast. In other words instead of seeing these activities as a mindless fetish, see them for what they are: one of the main reasons I am a CPAN contributor to begin with. --ribasushi --- diff --git a/.travis.yml b/.travis.yml index b0b3078..1bd9d4d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -174,7 +174,12 @@ matrix: # which ones of the above can fail allow_failures: - - perl: 5.12.4_thr_mb + + # Fails tests because of https://github.com/Perl-Toolchain-Gang/CPAN-Meta/issues/25 + # Can't be simply masked due to https://rt.cpan.org/Ticket/Display.html?id=88903 + - perl: 5.10.0_thr_dbg + + # these run with various dev snapshots - allowed to fail - perl: devcpan_5.18.1_thr_mb - perl: bleadperl_thr_mb - perl: devcpan_bleadperl_thr_mb diff --git a/maint/travis-ci_scripts/30_before_script.bash b/maint/travis-ci_scripts/30_before_script.bash index d23b6cd..706c979 100755 --- a/maint/travis-ci_scripts/30_before_script.bash +++ b/maint/travis-ci_scripts/30_before_script.bash @@ -45,9 +45,7 @@ if [[ "$CLEANTEST" = "true" ]]; then for m in \ ExtUtils::MakeMaker \ ExtUtils::CBuilder \ -R/RS/RSAVAGE/Tree-DAG_Node-1.13.tgz \ Module::Build \ -E/ET/ETHER/Class-Method-Modifiers-2.04.tar.gz \ ; do run_or_err "Pre-installing $m" "cpan $m" if ! perl -e ' @@ -64,7 +62,6 @@ eval ( q{require } . ( done fi - # DBI has by far the longest test runtime - run less tests # FIXME horrible horrible hack, need to implement in DBI itself run_or_err "Downloading latest DBI distdir from CPAN" \ @@ -117,30 +114,67 @@ if [[ "$CLEANTEST" = "true" ]]; then HARD_DEPS="$(echo $(make listdeps))" ##### TEMPORARY WORKAROUNDS + if ! 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 + + # 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 - # 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 - perl -M5.008008 -e 1 &> /dev/null || \ - HARD_DEPS="$(extract_prereqs Params::Validate) $HARD_DEPS" + run_or_err "Installing/testing dependencies (may take up to 5 minutes): $HARD_DEPS" "cpan $HARD_DEPS" -##### END TEMPORARY WORKAROUNDS + # save the log as we may need it + INSTALLDEPS_OUT="$LASTOUT" - run_or_err "Installing/testing dependencies (may take up to 3 minutes): $HARD_DEPS" "cpan $HARD_DEPS" +### FIXME in case we set it earlier in a workaround + if [[ -n "$HARNESS_SUBCLASS" ]] ; then - # this is a fucked CPAN - save the log as we may need it - CPAN_is_sane || INSTALLDEPS_OUT="$LASTOUT" + INSTALLDEPS_SKIPPED_TESTLIST=$(perl -0777 -e ' +my $in = <>; +my $re = qr( + ^ (?: \QBuilding and testing\E | \s* CPAN\.pm: .+? (?i:build)\S* ) \s+ (\S+) + .*? + ^ === \s \QSkipping nonessential autogenerated tests: \E([^\n]+) +)msx; +while ( $in =~ /$re/g ) { + print "!!! Skipped nonessential tests while installing $1: $2\n" +} +' <<< "$LASTOUT") -else - # listalldeps is deliberate - will upgrade everything it can find - parallel_installdeps_notest $(make listalldeps) + unset HARNESS_SUBCLASS + fi +else if [[ -n "$TEST_BUILDER_BETA_CPAN_TARBALL" ]] ; then parallel_installdeps_notest $TEST_BUILDER_BETA_CPAN_TARBALL fi + + # listalldeps is deliberate - will upgrade everything it can find + parallel_installdeps_notest $(make listalldeps) fi -echo_err "$(tstamp) Dependency configuration finished" +echo_err "$(tstamp) Dependency installation finished" # this will display list of available versions perl Makefile.PL diff --git a/maint/travis-ci_scripts/40_script.bash b/maint/travis-ci_scripts/40_script.bash index f43fdbb..0ad3961 100755 --- a/maint/travis-ci_scripts/40_script.bash +++ b/maint/travis-ci_scripts/40_script.bash @@ -37,6 +37,14 @@ if [[ -z "$DBICTRACE" ]] && [[ -z "$POISON_ENV" ]] && [[ -s "$TEST_STDERR_LOG" ] echo "=============================================================" echo "End of test run STDERR output ($STDERR_LOG_SIZE lines)" echo + + if [[ -n "$INSTALLDEPS_SKIPPED_TESTLIST" ]] ; then + echo "The following non-essential tests were skipped during deps installation" + echo "=============================================================" + echo "$INSTALLDEPS_SKIPPED_TESTLIST" + echo "=============================================================" + echo + fi fi echo "$(tstamp) Testing took a total of $(( $TEST_T1 - $TEST_T0 ))s" diff --git a/maint/travis-ci_scripts/common.bash b/maint/travis-ci_scripts/common.bash index 691323a..cfa4ffe 100755 --- a/maint/travis-ci_scripts/common.bash +++ b/maint/travis-ci_scripts/common.bash @@ -54,8 +54,16 @@ extract_prereqs() { exit 1 fi - # throw away non-children (what was in $@), throw away ascii art, convert to modnames - perl -p -e 's/^[a-z].+//i; s/^[^a-z]+//i; s/\-[^\-]+$/ /; s/\-/::/g' <<< "$OUT" + # throw away ascii art, convert to modnames + PQ=$(perl -p -e 's/^[^a-z]+//i; s/\-[^\-]+$/ /; s/\-/::/g' <<< "$OUT") + + # throw away what was in $@ + for m in "$@" ; do + PQ=$( perl -p -e 's/(?:\s|^)\Q'"$m"'\E(?:\s|$)/ /mg' <<< "$PQ") + done + + # RV + echo "$PQ" } parallel_installdeps_notest() { @@ -87,5 +95,6 @@ parallel_installdeps_notest() { " } - 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/maint/travis-ci_scripts/lib/TAP/Harness/IgnoreNonessentialDzilAutogeneratedTests.pm b/maint/travis-ci_scripts/lib/TAP/Harness/IgnoreNonessentialDzilAutogeneratedTests.pm new file mode 100644 index 0000000..f8d3c6d --- /dev/null +++ b/maint/travis-ci_scripts/lib/TAP/Harness/IgnoreNonessentialDzilAutogeneratedTests.pm @@ -0,0 +1,62 @@ +package TAP::Harness::IgnoreNonessentialDzilAutogeneratedTests; + +use warnings; +use strict; + +use base 'TAP::Harness'; +use File::Spec; +use IPC::Open2 'open2'; + +my $frivolous_test_map = { +# Test based on the extremely dep-heavy, *prone to failures* Test::CheckDeps +# + '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 +# + 't/00-compile.t' => [ + qr|^\Q# this test was generated with Dist::Zilla::Plugin::Test::Compile|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->{$fn}) { + 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 (@$skip_tests) { + + my $pid = open2(File::Spec->devnull, undef, $^X, qw(-I blib -I arch/lib), $_ ) + or die "Sub-proc failed: $!"; + waitpid ($pid, 0); + + $_ .= "[would NOT have passed: $?]" if $?; + } + + print STDERR "=== Skipping nonessential autogenerated tests: @$skip_tests\n"; + } + + return $self->SUPER::aggregate_tests($aggregate, @$run_tests); +} + +1;