diff mbox

[Xen-devel,OSSTEST] sg-report-flight: Add a succcess/failure column header.

Message ID 1412250966-14374-1-git-send-email-ian.campbell@citrix.com
State New
Headers show

Commit Message

Ian Campbell Oct. 2, 2014, 11:56 a.m. UTC
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 mbox

Patch

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);