From: Peter Rabbitson Date: Thu, 23 Oct 2014 09:44:49 +0000 (+0200) Subject: (travis) Feeble attempt at reverting f207111d X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=0d383895cb77f4e4dc9f51748910df12771607a4;p=dbsrgits%2FDBIx-Class-Historic.git (travis) Feeble attempt at reverting f207111d The toolchain gang became *a little* more reasonable in the past year, let's see how far we get without this particular set of workarounds --- diff --git a/maint/travis-ci_scripts/30_before_script.bash b/maint/travis-ci_scripts/30_before_script.bash index 3d0fae8..5c0cb00 100755 --- a/maint/travis-ci_scripts/30_before_script.bash +++ b/maint/travis-ci_scripts/30_before_script.bash @@ -139,13 +139,6 @@ if [[ "$CLEANTEST" = "true" ]]; then ##### 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" 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;