All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH OSSTEST] sg-report-flight: Add a succcess/failure column header.
@ 2014-10-02 11:56 Ian Campbell
  2014-10-02 17:06 ` [OSSTEST PATCH v2] " Ian Jackson
  0 siblings, 1 reply; 5+ messages in thread
From: Ian Campbell @ 2014-10-02 11:56 UTC (permalink / raw)
  To: ian.jackson; +Cc: Ian Campbell, xen-devel

There are so many rows and columns that scrolling around trying to find the
column associated with a failure is getting pretty tricky. Finding all failing
columns is even harder. Add a clue near the top.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
---
 sg-report-flight | 23 ++++++++++++++++++-----
 1 file changed, 18 insertions(+), 5 deletions(-)

diff --git a/sg-report-flight b/sg-report-flight
index 4760656..7c955da 100755
--- a/sg-report-flight
+++ b/sg-report-flight
@@ -367,8 +367,6 @@ END
     $? and die "tsort $?";
 
     foreach my $j (@$jobs) {
-        push @gridcol_job, $j->{job};
-
 	$statuscounts{$j->{status}}++;
 
 	my $jobtext= sprintf "%s:\n", $j->{job};
@@ -448,6 +446,7 @@ END
         }
 
 	push @jobtexts, [ split /\n/, $jobtext ];
+	push @gridcol_job, [ $j->{job},$foundfail ];
     }
 
     my $outcomes= join '/', sort keys %statuscounts;
@@ -899,7 +898,7 @@ sub htmlout ($) {
 
     my @cols= @{ $fi->{GridCols} };
 
-    htmloutjob($fi, $_) foreach @cols;
+    htmloutjob($fi, $_->[0]) foreach @cols;
 
     my $htmlout= "$htmldir/index.html";
     open H, "> $htmlout.new" or die "$htmlout.new $!";
@@ -913,7 +912,7 @@ END
     print H encode_entities($fi->{FlightInfo}{blessing});
     print H "</th>\n";
 
-    foreach my $col (@cols) {
+    foreach my $col (map { @{$_}[0] } @cols) {
         my $th= $col;
         $th =~ s/\-/ $&/g;
         print H "<th>";
@@ -923,6 +922,20 @@ END
         print H "</th>";
     }
     print H "\n";
+    print H "<tr><th>";
+    print H "Status";
+    print H "</th>\n";
+    foreach my $col (map { @{$_}[1] } @cols) {
+        my ($colour,$text) = $col ?
+            ("#ff8888","Failed") :
+            ("#008800", "Success");
+
+        print H "<th bgcolor=$colour>$text</th>";
+    }
+    print H "\n";
+    # Create a gutter row after the headers.
+    print H "<tr><td>&nbsp;</td></tr>\n";
+
     foreach my $rowix (0..$#{ $fi->{GridRows} }) {
         next unless $fi->{GridRows}[$rowix];
         my $rowdesc= encode_entities($fi->{GridRows}[$rowix]);
@@ -958,7 +971,7 @@ END
             $label->($ndeferred, 'right');
         };
 
-        foreach my $col (@cols) {
+        foreach my $col (map { @{$_}[0] } @cols) {
             my $ei= $fi->{GridGrid}{$col}[$rowix];
             if ($ei) {
                 $deferred_cells->(1);
-- 
2.1.0

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [OSSTEST PATCH v2] sg-report-flight: Add a succcess/failure column header.
  2014-10-02 11:56 [PATCH OSSTEST] sg-report-flight: Add a succcess/failure column header Ian Campbell
@ 2014-10-02 17:06 ` Ian Jackson
  2014-10-03  8:38   ` Ian Campbell
  0 siblings, 1 reply; 5+ messages in thread
From: Ian Jackson @ 2014-10-02 17:06 UTC (permalink / raw)
  To: xen-devel; +Cc: Ian Jackson, Ian Campbell

From: Ian Campbell <ian.campbell@citrix.com>

There are so many rows and columns that scrolling around trying to find the
column associated with a failure is getting pretty tricky. Finding all failing
columns is even harder.

Add a clue near the top: replicate the worst or most interesting step
result box contents and colour.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>

---
v2: Do it entirely differently.
---
 sg-report-flight |   85 ++++++++++++++++++++++++++++++++++++------------------
 1 file changed, 57 insertions(+), 28 deletions(-)

diff --git a/sg-report-flight b/sg-report-flight
index 4760656..c8d88e8 100755
--- a/sg-report-flight
+++ b/sg-report-flight
@@ -822,7 +822,7 @@ END
         my $st= $step->{status};
         my $logfilename= "$step->{stepno}.$step->{step}.log";
         printf H "<td bgcolor='%s'><a href='%s'>%s</a></td>",
-            html_status2colour($st),
+	    (html_status2_colour_priority($st))[0],
             encode_entities(uri_escape($logfilename)),
             encode_entities($st);
         $issteplog{$logfilename}= 1;
@@ -886,11 +886,11 @@ END
     rename "$htmlfile.new", $htmlfile or die $!;
 }
 
-sub html_status2colour ($) {
+sub html_status2_colour_priority ($) {
     my ($st) = @_;
-    return ($st eq 'pass' ? '#008800' :
-            $st eq 'fail' ? '#ff8888' :
-            '#ffff00');
+    return ($st eq 'pass' ? ('#008800',100) :
+            $st eq 'fail' ? ('#ff8888',200) :
+            ('#ffff00',300));
 }
 
 sub htmlout ($) {
@@ -923,6 +923,56 @@ END
         print H "</th>";
     }
     print H "\n";
+    print H "<tr><th>";
+    print H "Worst/last";
+    print H "</th>";
+
+    my $cell_html = sub {
+	my ($ei) = @_;
+	# => ($h, $priority);
+	my $s= $ei->{Step};
+	my $sum_core= $ei->{SummaryCore};
+	$sum_core= $ei->{Summary} if !defined $sum_core;
+	my $sum_flight= $ei->{SummaryRefFlight};
+	my $bgc;
+	my $priority;
+	if (!defined $sum_core || !length $sum_core) {
+	    $sum_core= $s->{status};
+	    ($bgc,$priority)= html_status2_colour_priority($s->{status});
+	} else {
+	    ($bgc,$priority) =
+		$ei->{Blocker} eq 'regression'
+		? ('#ff8888',400)
+		: ('#ffff00',250);
+	}
+	my $h = " bgcolor=\"$bgc\">";
+	$h .= "<a href=\"".encode_entities($s->{job}).
+	    "/$s->{stepno}.".encode_entities($s->{step}).".log\">";
+	#print H "[$s->{stepno}] ";
+	$h .= encode_entities($sum_core);
+	$h .= "</a>";
+	if (defined $sum_flight) {
+	    $h .= " <a href=\"../$sum_flight/\">".
+		displayflightnum($sum_flight)."</a>";
+	}
+	return ($h,$priority);
+    };
+
+    foreach my $col (@cols) {
+	my @worst=(' bgcolor="#444444">',0);
+	foreach my $rowix (0..$#{ $fi->{GridRows} }) {
+            my $ei= $fi->{GridGrid}{$col}[$rowix];
+	    next unless $ei;
+	    my @this = $cell_html->($ei);
+	    next if $this[1] < $worst[1];
+	    @worst=@this;
+	}
+        print H "<td ",$worst[0],"</td>";
+    }
+    print H "\n";
+    # Create a gutter row after the headers.
+    print H "<tr><td>&nbsp;</td></tr>\n";
+
     foreach my $rowix (0..$#{ $fi->{GridRows} }) {
         next unless $fi->{GridRows}[$rowix];
         my $rowdesc= encode_entities($fi->{GridRows}[$rowix]);
@@ -962,30 +1012,9 @@ END
             my $ei= $fi->{GridGrid}{$col}[$rowix];
             if ($ei) {
                 $deferred_cells->(1);
-                print H "<td";
                 my $s= $ei->{Step};
-                my $sum_core= $ei->{SummaryCore};
-                my $sum_flight= $ei->{SummaryRefFlight};
-                $sum_core= $ei->{Summary} if !defined $sum_core;
-                my $bgc;
-                if (!defined $sum_core || !length $sum_core) {
-                    $sum_core= $s->{status};
-                    $bgc= html_status2colour($s->{status});
-                } else {
-                    $bgc= $ei->{Blocker} eq 'regression'
-                        ? '#ff8888' : '#ffff00';
-                }
-                print H " bgcolor=\"$bgc\">";
-                print H "<a href=\"".encode_entities($col).
-                    "/$s->{stepno}.".encode_entities($s->{step}).".log\">";
-                #print H "[$s->{stepno}] ";
-                print H encode_entities($sum_core);
-                print H "</a>";
-                if (defined $sum_flight) {
-                    print H " <a href=\"../$sum_flight/\">".
-			displayflightnum($sum_flight)."</a>";
-                }
-                print H "</td>";
+		my ($h,$priority) = $cell_html->($ei);
+                print H "<td", $h, "</td>";
             } else {
                 $ndeferred++;
             }
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [OSSTEST PATCH v2] sg-report-flight: Add a succcess/failure column header.
  2014-10-02 17:06 ` [OSSTEST PATCH v2] " Ian Jackson
@ 2014-10-03  8:38   ` Ian Campbell
  2014-10-03 11:21     ` Ian Jackson
  0 siblings, 1 reply; 5+ messages in thread
From: Ian Campbell @ 2014-10-03  8:38 UTC (permalink / raw)
  To: Ian Jackson; +Cc: xen-devel

On Thu, 2014-10-02 at 18:06 +0100, Ian Jackson wrote:
> From: Ian Campbell <ian.campbell@citrix.com>
> 
> There are so many rows and columns that scrolling around trying to find the
> column associated with a failure is getting pretty tricky. Finding all failing
> columns is even harder.
> 
> Add a clue near the top: replicate the worst or most interesting step
> result box contents and colour.
> 
> Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
> 
> ---
> v2: Do it entirely differently.

The result is indeed better, but it's different enough that I think you
can drop the From:.

Personally I'd have made $cell_html include the "<td" and "</td>" in the
result, since both of the callers just paste it into that context
anyway, but up to you.

Ian.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [OSSTEST PATCH v2] sg-report-flight: Add a succcess/failure column header.
  2014-10-03  8:38   ` Ian Campbell
@ 2014-10-03 11:21     ` Ian Jackson
  2014-10-03 12:42       ` Ian Campbell
  0 siblings, 1 reply; 5+ messages in thread
From: Ian Jackson @ 2014-10-03 11:21 UTC (permalink / raw)
  To: Ian Campbell; +Cc: xen-devel

Ian Campbell writes ("Re: [OSSTEST PATCH v2] sg-report-flight: Add a succcess/failure column header."):
> Personally I'd have made $cell_html include the "<td" and "</td>" in the
> result, since both of the callers just paste it into that context
> anyway, but up to you.

In some versions these cells were <th>.

Ian.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [OSSTEST PATCH v2] sg-report-flight: Add a succcess/failure column header.
  2014-10-03 11:21     ` Ian Jackson
@ 2014-10-03 12:42       ` Ian Campbell
  0 siblings, 0 replies; 5+ messages in thread
From: Ian Campbell @ 2014-10-03 12:42 UTC (permalink / raw)
  To: Ian Jackson; +Cc: xen-devel

On Fri, 2014-10-03 at 12:21 +0100, Ian Jackson wrote:
> Ian Campbell writes ("Re: [OSSTEST PATCH v2] sg-report-flight: Add a succcess/failure column header."):
> > Personally I'd have made $cell_html include the "<td" and "</td>" in the
> > result, since both of the callers just paste it into that context
> > anyway, but up to you.
> 
> In some versions these cells were <th>.

Ah, makes sense then.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-10-03 12:42 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-02 11:56 [PATCH OSSTEST] sg-report-flight: Add a succcess/failure column header Ian Campbell
2014-10-02 17:06 ` [OSSTEST PATCH v2] " Ian Jackson
2014-10-03  8:38   ` Ian Campbell
2014-10-03 11:21     ` Ian Jackson
2014-10-03 12:42       ` Ian Campbell

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.