From: Ian Jackson Subject: [OSSTEST PATCH 11/13] Reporting: In history tables, show multiple failure steps Date: Mon, 29 Jun 2015 18:14:47 +0100 Message-ID: <1435598089-21647-12-git-send-email-ian.jackson@eu.citrix.com> References: <1435598089-21647-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 1Z9cti-0008LY-PF for xen-devel@lists.xenproject.org; Mon, 29 Jun 2015 17:31:10 +0000 In-Reply-To: <1435598089-21647-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 --- Osstest/Executive.pm | 32 ++++++++++++++++++++++---------- 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/Osstest/Executive.pm b/Osstest/Executive.pm index ba668bc..9f90f67 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