Streamline postmortem analysis, and fix non-essential-test report being lost
[dbsrgits/DBIx-Class.git] / maint / travis-ci_scripts / 30_before_script.bash
index 44218a6..46eef91 100755 (executable)
@@ -123,17 +123,37 @@ if [[ "$CLEANTEST" = "true" ]]; then
   if [[ -n "$HARNESS_SUBCLASS" ]] ; then
 
     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"
+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 "The following non-essential tests were skipped during deps installation"
+        echo "============================================================="
+        echo "$INSTALLDEPS_SKIPPED_TESTLIST"
+        echo "============================================================="
+        echo
+      )"
+    fi
+
     unset HARNESS_SUBCLASS
   fi