From: Peter Rabbitson Date: Mon, 23 Sep 2013 19:36:03 +0000 (+0200) Subject: Better diagnostics of skipped non-essential tests X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=1e735709defff74baa9437ed13bfaeb65f3d0c8f;p=dbsrgits%2FDBIx-Class-Historic.git Better diagnostics of skipped non-essential tests --- diff --git a/maint/travis-ci_scripts/10_before_install.bash b/maint/travis-ci_scripts/10_before_install.bash index 12a6189..fa50ffc 100755 --- a/maint/travis-ci_scripts/10_before_install.bash +++ b/maint/travis-ci_scripts/10_before_install.bash @@ -13,6 +13,11 @@ if [[ -n "$SHORT_CIRCUIT_SMOKE" ]] ; then return ; fi # `processor : XX` line export NUMTHREADS=$(( $(perl -0777 -n -e 'print (/ (?: .+ ^ processor \s+ : \s+ (\d+) ) (?! ^ processor ) /smx)' < /proc/cpuinfo) + 1 )) +run_or_err "Installing App::Nopaste from APT" "sudo apt-get install --allow-unauthenticated -y libapp-nopaste-perl" +# FIXME - the debian package is oddly broken - uses a bin/env based shebang +# so nothing works under a brew. Fix here until #debian-perl patches it up +sudo /usr/bin/perl -p -i -e 's|#!/usr/bin/env perl|#!/usr/bin/perl|' $(which nopaste) + if [[ "$CLEANTEST" != "true" ]]; then ### apt-get invocation - faster to grab everything at once # diff --git a/maint/travis-ci_scripts/40_script.bash b/maint/travis-ci_scripts/40_script.bash index 0ad3961..3131d44 100755 --- a/maint/travis-ci_scripts/40_script.bash +++ b/maint/travis-ci_scripts/40_script.bash @@ -45,6 +45,9 @@ if [[ -z "$DBICTRACE" ]] && [[ -z "$POISON_ENV" ]] && [[ -s "$TEST_STDERR_LOG" ] echo "=============================================================" echo fi + + echo "Full dep install log at $(/usr/bin/nopaste -q -s Shadowcat -d DepInstall <<< "$INSTALLDEPS_OUT")" + echo fi echo "$(tstamp) Testing took a total of $(( $TEST_T1 - $TEST_T0 ))s" diff --git a/maint/travis-ci_scripts/lib/TAP/Harness/IgnoreNonessentialDzilAutogeneratedTests.pm b/maint/travis-ci_scripts/lib/TAP/Harness/IgnoreNonessentialDzilAutogeneratedTests.pm index f8d3c6d..2a4ef90 100644 --- a/maint/travis-ci_scripts/lib/TAP/Harness/IgnoreNonessentialDzilAutogeneratedTests.pm +++ b/maint/travis-ci_scripts/lib/TAP/Harness/IgnoreNonessentialDzilAutogeneratedTests.pm @@ -4,8 +4,9 @@ use warnings; use strict; use base 'TAP::Harness'; -use File::Spec; -use IPC::Open2 'open2'; +use File::Spec (); +use IPC::Open3 'open3'; +use File::Temp (); my $frivolous_test_map = { # Test based on the extremely dep-heavy, *prone to failures* Test::CheckDeps @@ -44,13 +45,29 @@ sub aggregate_tests { if ($skip_tests) { - for (@$skip_tests) { + for my $tfn (@$skip_tests) { - my $pid = open2(File::Spec->devnull, undef, $^X, qw(-I blib -I arch/lib), $_ ) - or die "Sub-proc failed: $!"; + (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` ); - $_ .= "[would NOT have passed: $?]" if $?; + $tfn .= "[would NOT have passed: $ex / $url]"; + } } print STDERR "=== Skipping nonessential autogenerated tests: @$skip_tests\n";