New version of dashboard (fancy stuff).
authorFrantišek Dvořák <valtri@civ.zcu.cz>
Fri, 9 Mar 2012 19:08:12 +0000 (20:08 +0100)
committerFrantišek Dvořák <valtri@civ.zcu.cz>
Fri, 9 Mar 2012 19:08:12 +0000 (20:08 +0100)
dashboard.pl

index e567078..0b2f688 100755 (executable)
@@ -117,9 +117,11 @@ foreach my $s (keys %list) {
                                if ($section == 0 && ($yaim_used != 0 || $yaim_finished == 0)) {
                                        $result=`grep -- '-TEST FAILED-' $item->{dir}/report.twiki 2>/dev/null| wc -l | sed 's/ *//g'`;
                                        chomp $result;
+                                       if ( "$result" == "1" ) { $result="<B>$result error</B>"; }
+                                       else { $result="<B>$result errors</B>"; }
                                } else {
-                                       if ($section == 0) { $result = 'Error'; }
-                                       else { $result = 'Failed'; }
+                                       if ($section == 0) { $result = '<B>Error</B>'; }
+                                       else { $result = '<B>Failed</B>'; }
                                }
                        } else { undef $result; }
                        $item->{result} = defined $result ? $result : '-';
@@ -166,6 +168,11 @@ foreach my $c (sort keys %components) {
 
 
 # ==== matrix ====
+my %fancy = ("lb", "L&B",
+         "px", "PX",
+         "gridsite", "GridSite",
+         "canl-c", "caNl-c",
+         "canl", "caNl");
 $n_platforms = 0;
 for my $i (keys %platforms) { $n_platforms++; }
 $width = " width:".(100/(1+$n_platforms))."%;";
@@ -176,20 +183,29 @@ print qq(<?xml version="1.0" encoding="UTF-8"?>
 <html xmlns="http://www.w3.org/1999/xhtml">
 
 <head>
-       <title>Reports by platform table</title>
+       <title>Continuous Test Dashboard</title>
        <style type="text/css">
+               a:link {color:black;}
+               a:visited {color:#111111;}
+               a:hover {color:#333333;}
+               a:active {color:#222222;}
                table.main {border:none;}
-               table.cert {border:1px solid black; border-collapse:collapse; text-align:center;}
-               th.cert, td.cert {border:1px solid black; text-align:center;}
-               .OK {border:1px solid black; text-align:center;background-color: #80FF80;}
-               .FAIL {border:1px solid black; text-align:center;background-color: #FF2020;}
+               table.cert {border:1px solid black; border-collapse:collapse; text-align:center; width:1024px; table-layout:fixed;}
+               th.cert, td.cert {border:0px solid black; text-align:center; padding:5px;}
+               .scen {font-size:small; font-style:italic; background-color: #eeeeee; }
+               .prod {font-family:sans-serif; font-size:large; font-weight:bold; background-color: #eeeeee}
+               .OK {border:1px solid black; text-align:center;background-color: #90f3a5;}
+               .FAIL {border:1px solid black; text-align:center;background-color: #ff4c4c;}
+               .NA {border:1px solid black; text-align:center;background-color: #ffffff;}
                .date {font-size:xx-small; color: #404040;}
+               .platf{font-family:sans-serif; border:1px solid black; text-align:center;background-color: #eeeeee;}
                .comment {font-size:small;margin:0px 0px 0px 0px;}
                p.comment {margin:15px 0px 0px 0px;}
                p.modified {margin:0px 0px 0px 0px;}
-               table.modified {border:0px none; width:100%;}
-               td.modified {border:0px none; float:right; text-align: right;}
-               td.reports {border: 0px none; float:left; text-align:left; white-space:nowrap;}
+               table.modified {border:0px none; width:1024px;}
+               td.modified {font-size:small; border:0px none; float:right; text-align: right;}
+               td.thanks {font-size:small; border:0px none; text-align: right;}
+               td.heading {font-size:xx-large; font-family:sans-serif; font-weight:bold; border: 0px none; float:left; text-align:left; white-space:nowrap;}
        </style>
 </head>
 
@@ -200,12 +216,8 @@ print qq(<?xml version="1.0" encoding="UTF-8"?>
                <td>
                        <table class="modified">
                                <tr>
-                                       <td class="reports">);
-foreach my $c (sort keys %components) {
-       print "<a href=\"report-$c.twiki\">report-$c.twiki</a> ";
-}
-print qq(</td>
-                                       <td class="modified">Modified: $now</td>
+                                       <td class="heading">Continuous Test Dashboard</td>
+                                       <td class="thanks"><IMG ALT=MetaCentrum SRC="http://www.metacentrum.cz/export/sites/metacentrum/images/metalogo/metalogo_pruhledne_150.png"></td>
                                </tr>
                        </table>
                </td>
@@ -215,49 +227,61 @@ print qq(</td>
 
 );
 
-if (exists $list{install}) {
-       print "<a name=\"install\"/><h1>Install</h1>\n";
-       table($list{install});
-       print "\n";
-       if (-f 'install.html.in') {
-               system 'cat install.html.in';
-       }
-}
+{
+       my $class;
+       my ($classi, $classu);
 
-if (exists $list{upgrade}) {
-       print "<a name=\"upgrade\"/><h1>Upgrade</h1>\n";
-       table($list{upgrade});
-       print "\n";
-       if (-f 'upgrade.html.in') {
-               system 'cat upgrade.html.in';
-       }
-}
 
-if (exists $list{build}) {
-       print "<a name=\"build\"/><h1>Local build</h1>\n";
-       table($list{build});
-       print "\n";
-       if (-f 'build.html.in') {
-               system 'cat build.html.in';
+       print qq(<table class="cert">
+       <tr class="cert">
+               <th class="prod"></th>
+);
+       foreach my $c (sort keys %components) {
+               print "         <th class=\"prod\" colspan=\"2\">$fancy{$c}</th>\n";
        }
-}
-
-if (exists $list{perf}) {
-       my @keys = keys %{$list{perf}};
-       my %keys;
-       map { $keys{$_} = 1; } @keys;
+       print " </tr>\n";
+               print "         <th class=\"scen\">Platform</th>\n";
+       foreach my $c (sort keys %components) {
+               print "         <th class=\"scen\">Install</th>\n";
+               print "         <th class=\"scen\">Upgrade</th>\n";
+       }
+       print " </tr>\n";
+       foreach my $p (sort keys %platforms) {
+               print " <tr class=\"platf\">\n          <th class=\"cert\">$p</th>\n";
+               foreach my $c (sort keys %components) {
+                       $item = $list{install}{$c}{$p};
+                       if (defined $item) {
+                               $result = $item->{result};
+                               if ($item->{result} eq '0') { $class='OK'; }
+                               else { $class='FAIL'; }
+                               print "         <td class=\"$class\"><span class=\"date\">$item->{date}</span><br/><a href=\"$item->{dir}/\">$result</a></td>\n";
+                       } else {
+                               print "         <td class=\"NA\"></td>\n"
+                       }
 
-       print "<a name=\"perf\"/><h1>L&amp;B performance tests</h1>\n";
-       table2(1, $list{perf}, \%keys);
-       print "\n";
-       if (-f 'perf.html.in') {
-               system 'cat perf.html.in';
+                       $item = $list{upgrade}{$c}{$p};
+                       if (defined $item) {
+                               $result = $item->{result};
+                               if ($item->{result} eq '0') { $class='OK'; }
+                               else { $class='FAIL'; }
+                               print "         <td class=\"$class\"><span class=\"date\">$item->{date}</span><br/><a href=\"$item->{dir}/\">$result</a></td>\n";
+                       } else {
+                               print "         <td class=\"NA\"></td>\n"
+                       }
+               }
+               print " </tr>\n";
        }
+       print "</table>\n\n";
 }
 
 print qq{              </td>
        </tr>
 </table>
+<table class="modified">
+       <tr>
+               <td class="modified">Last Modified: $now</td>
+       </tr>
+</table>
 
 </body>