From: Ian Jackson Subject: [OSSTEST PATCH 12/14] Reporting: In history tables, show multiple failure steps Date: Tue, 30 Jun 2015 10:57:49 +0100 Message-ID: <1435658271-31823-13-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.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Z9sIo-0007RS-8T 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 In report_run_getinfo, used by sg-report-job-history and sg-report-host-history, make provision for reporting multiple failed steps. The failed steps are put side by side (in a single table cell). The cell background is set by the job status, but the individual steps may vary their colour, as seen in this example: http://xenbits.xen.org/people/iwj/2015/linux-next.html Signed-off-by: Ian Jackson Acked-by: Ian Campbell --- v2: Remove unnecessary space in ColourAttr --- Osstest/Executive.pm | 32 ++++++++++++++++++++++---------- 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/Osstest/Executive.pm b/Osstest/Executive.pm index b757618..87f2e98 100644 --- a/Osstest/Executive.pm +++ b/Osstest/Executive.pm @@ -222,19 +222,31 @@ sub report_run_getinfo ($) { WHERE flight=? AND job=? AND status!='pass' ORDER BY stepno - LIMIT 1 END $failstepq->execute($f->{flight}, $f->{job}); - my $fs= $failstepq->fetchrow_hashref(); - if (!defined $fs) { - return $single->("(unknown)", $yellow); - } elsif ($fs->{status} eq 'fail') { - return $single->("$fs->{testid}", $failcolour); - } elsif ($fs->{status} eq 'broken') { - return $single->("$fs->{testid} broken", $yellow); - } else { - return $single->("$fs->{testid} $fs->{status}", $failcolour); + my @content; + while (my $fs = $failstepq->fetchrow_hashref()) { + my $summary = $fs->{testid}; + my $colour; + if ($fs->{status} eq 'fail') { + $colour = $red; + } elsif ($fs->{status} eq 'broken') { + $summary .= " broken"; + $colour = $yellow; + } else { + $summary .= " $fs->{status}"; + $colour = $failcolour; + } + push @content, "". + encode_entities($summary).""; } + if (!@content) { + return $single->("(unknown)", $yellow); + } + return { + Content => (join " | ", @content), + ColourAttr => "bgcolor=\"$failcolour\"", + }; } elsif ($status eq 'blocked') { return $single->("blocked", $purple), } else { -- 1.7.10.4