From: Ian Jackson Subject: [OSSTEST PATCH 14/14] Reporting: sg-report-flight: Put overall pushgate stats in email Date: Tue, 30 Jun 2015 10:57:51 +0100 Message-ID: <1435658271-31823-15-git-send-email-ian.jackson@eu.citrix.com> References: <1435658271-31823-1-git-send-email-ian.jackson@eu.citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Z9sIo-0007Pp-1q for xen-devel@lists.xenproject.org; Tue, 30 Jun 2015 09:58:06 +0000 In-Reply-To: <1435658271-31823-1-git-send-email-ian.jackson@eu.citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel@lists.xenproject.org Cc: Ian Jackson , Ian Campbell List-Id: xen-devel@lists.xenproject.org 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 --- v2: Swap order of `Failing since' and `Testing same since' output lines --- sg-report-flight | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/sg-report-flight b/sg-report-flight index 3c360e5..22a82ff 100755 --- a/sg-report-flight +++ b/sg-report-flight @@ -499,6 +499,45 @@ 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)"; + } + 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 <