]> xenbits.xensource.com Git - people/liuw/osstest.git/commitdiff
Reporting: sg-report-flight: Put overall pushgate stats in email
authorIan Jackson <ian.jackson@eu.citrix.com>
Mon, 29 Jun 2015 17:06:11 +0000 (18:06 +0100)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Wed, 1 Jul 2015 12:34:09 +0000 (13:34 +0100)
This adds something like this (would have appeared in 37638):

  Last test of basis    37629  2015-06-24 21:36:10 Z    4 days
  Failing since         37630  2015-06-26 10:35:44 Z    3 days    9 attempts
  Testing same since    37635  2015-06-28 03:05:56 Z    1 days    4 attempts

or this (would have appeared in 37629):

  Last test of basis    37617  2015-06-20 04:06:01 Z    9 days
  Testing same since    37628  2015-06-24 13:35:23 Z    5 days    2 attempts

(Both examples from the Cambridge instance.)

This is added just after the versions are reported.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
v2: Swap order of `Failing since' and `Testing same since' output lines
v3: Actually return when no pushgate summary wanted.

sg-report-flight

index 3c360e5fc980629017c39ddf7e700090fb8c0253..1f69c0847c3ec81cfce30c0ab0a4449317119a3f 100755 (executable)
@@ -499,6 +499,46 @@ sub printversions ($) {
     }
 }
 
+sub print_pushgate_summary () {
+    my @thistree = sort keys %{ $specver{'this'} };
+    my @thattree = sort keys %{ $specver{'that'} };
+    if (!(@thistree==1 && @thattree==1 && $thistree[0] eq $thattree[0])) {
+       print DEBUG "NO PUSHGATE SUMMARY (@thistree) != (@thattree)";
+       return
+    }
+    my $tree = $thistree[0];
+
+    my $info = report_find_push_age_info(
+       [ $blessings[0] ], $maxflight, [ $branch ],
+       $tree, $specver{that}{$tree}, $specver{this}{$tree}
+       );
+    print "\n";
+    my $now = time;
+    my $pinfo = sub {
+       my ($what, $flightkey, $countkey) = @_;
+       my $f = $info->{$flightkey};
+       my $count = $info->{$countkey};
+       printf "%-20s", $what;
+       if ($f) {
+           printf(" %6d  %s %4d days",
+                  $f->{flight},
+                  show_abs_time($f->{started}),
+                  floor(($now - $f->{started}) / 86400));
+       } else {
+           printf(" %34s     ","(not found)");
+       }
+       if (defined $count) {
+           printf(" %4d attempts", $count);
+       }
+       print "\n";
+    };
+    $pinfo->('Last test of basis', "Basis",'');
+    $pinfo->('Failing since', "FirstAfterBasis","CountAfterBasis")
+        unless ($info->{FirstAfterBasis}{flight} // 'NONE')
+           eq ($info->{FirstTip}{flight}        // 'NONE');
+    $pinfo->('Testing same since', "FirstTip","CountTip");
+}
+
 sub printout {
     my ($r, @failures) = @_;
     print <<END or die $!;
@@ -579,6 +619,8 @@ END
         printversions('that');
     }
 
+    print_pushgate_summary();
+
     if (@includefiles) {
         print "\n","-"x60, "\n" or die $!;
     }