Add testcases detail column to status page
authorJeremy Harris <jgh@wizmail.org>
Mon, 28 Nov 2016 17:40:14 +0000 (17:40 +0000)
committerJeremy Harris <jgh@wizmail.org>
Mon, 28 Nov 2016 17:40:14 +0000 (17:40 +0000)
cgi-bin/show_status.pl
htdocs/img/t_fail.gif [new file with mode: 0644]
htdocs/img/t_good.gif [new file with mode: 0644]
htdocs/img/t_notdone.gif [new file with mode: 0644]
templates/log.tt
templates/status.tt

index f371bdc9a186783b15c32fe3551fb4ca3eba0f48..baf9623197acae357d3ad9f7606a7abcb035bf8b 100755 (executable)
@@ -48,11 +48,14 @@ my $db = DBI->connect($dsn,$dbuser,$dbpass,{pg_expand_array => 0})
 my $statement =<<EOS;
 
 
-  select timezone('GMT'::text, now())::timestamp(0) without time zone - b.snapshot AS when_ago, b.*
-  from dashboard_mat b
-  order by branch = 'master' desc,
-        branch desc, $sort_clause 
-        snapshot desc
+  SELECT timezone('GMT'::text, now())::timestamp(0) without time zone - b.snapshot AS when_ago,
+       b.*,
+       s.log_text
+  FROM dashboard_mat b LEFT JOIN build_status_log s
+  ON b.snapshot = s.snapshot AND s.log_stage = 'test-results.log'
+  ORDER BY b.branch = 'master' desc,
+        b.branch desc, $sort_clause 
+        b.snapshot desc
 
 EOS
 ;
@@ -67,6 +70,10 @@ while (my $row = $sth->fetchrow_hashref)
     $row->{build_flags}  =~ s/,/ /g;
     $row->{build_flags}  =~ s/_PC\b//g;
     $row->{build_flags} = lc($row->{build_flags});
+    if (defined($row->{log_text}))
+      {                # convert to a hash
+      $row->{log_text} = { split /\s+/, $row->{log_text} };
+      }
     push(@$statrows,$row);
 }
 $sth->finish;
diff --git a/htdocs/img/t_fail.gif b/htdocs/img/t_fail.gif
new file mode 100644 (file)
index 0000000..e3030bc
Binary files /dev/null and b/htdocs/img/t_fail.gif differ
diff --git a/htdocs/img/t_good.gif b/htdocs/img/t_good.gif
new file mode 100644 (file)
index 0000000..f8ddab0
Binary files /dev/null and b/htdocs/img/t_good.gif differ
diff --git a/htdocs/img/t_notdone.gif b/htdocs/img/t_notdone.gif
new file mode 100644 (file)
index 0000000..7ac2089
Binary files /dev/null and b/htdocs/img/t_notdone.gif differ
index 223339743343f8e8473b15ad547d767ecc312e0c..e2ceffdb57c7a6cafe999c9bbdaafee3ee2ccae2 100644 (file)
@@ -133,9 +133,9 @@ not recorded
 [% IF changed_since_success_logs.0 %]
 <h5>Git log</h5>
 <pre>
-<a href="https://github.com/postgres/postgres/compare/[% last_success_git_ref %]...[% last_build_git_ref %]">Change Set prior to this build</a>
+<a href="https://github.com/Exim/exim/compare/[% last_success_git_ref %]...[% last_build_git_ref %]">Change Set prior to this build</a>
 
-<a href="https://github.com/postgres/postgres/compare/[% last_success_git_ref %]...[% git_head_ref %]">Change Set including this build</a>
+<a href="https://github.com/Exim/exim/compare/[% last_success_git_ref %]...[% git_head_ref %]">Change Set including this build</a>
 
 [% FOREACH clog IN changed_since_success_logs ; PROCESS gitlog -%]
 [%- END -%]
index f471f2a6d77c1c484debcf4d39b250664f699c76..f861f9bf1ad0a5ee8101b93a9ed3a6bce83f380a 100644 (file)
@@ -29,6 +29,13 @@ See accompanying License file for license details
      #'integer-datetimes' => '/img/days.png',
      }
 -%]
+[%
+ res_imgs = {
+     P = '/img/t_good.gif',
+     F => '/img/t_fail.gif',
+     '.' => '/img/t_notdone.gif',
+     }
+-%]
 [%- BLOCK img ; IF flag == 'depend' or flag == 'gnu-ld' ; ; ELSIF flag_imgs.$flag %]<img src="[% flag_imgs.$flag %]" title="[% flag %]" alt="[% flag %]" height="16" width="16" class="inline" align="bottom" />  [% ELSE %][%#
                                                                                                                                                                                                          flag ; ' '
 %][% END ; END -%]
@@ -37,6 +44,8 @@ See accompanying License file for license details
 [%- BLOCK cl %] class="[% SWITCH bgfor.replace('-.*','') -%]
   [%- CASE 'OK' %]pass[% CASE 'ContribCheck' %]warn[% CASE [ 'Check' 'InstallCheck' ] %]warnx[% CASE %]fail[% END %]"
 [%- END -%]
+[%# The IF-backstop is ugly and I'm not understanding why the res_img lookup does not for for '.' -%]
+[%- BLOCK test_result %]<img src="[% IF res_imgs.$r.defined ; res_imgs.$r ; ELSE %]/img/t_notdone.gif [% END %]" title="[% test %]" alt="[% r %]" height="16" width="1" class="inline" align="bottom" />[%- END -%]
 [% WRAPPER 'page.tt' 
        title = 'Exim BuildFarm Status'
        bodyclass = 'none'
@@ -62,8 +71,8 @@ See accompanying License file for license details
 [% brch = "" %]
 [% FOREACH row IN statrows %]
 [% IF row.branch != brch ; brch = row.branch %]
-<tr><th class="head" colspan="5">Branch: [% brch %]</th></tr>
-<tr><th colspan="2">Alias</th><th>System</th><th>Status</th><th>Flags</th></tr>
+<tr><th class="head" colspan="6">Branch: [% brch %]</th></tr>
+<tr><th colspan="2">Alias</th><th>System</th><th>Status</th><th>Flags</th><th>Detail</th></tr>
 [% END %]
 <tr [% PROCESS cl bgfor=row.stage %]>
     <td><a 
@@ -86,6 +95,7 @@ See accompanying License file for license details
                 [%- IF row.stage != 'OK' %]Details[% ELSE %]Config[% END -%]</a></td>
 
     <td class="flags">[% FOREACH flag IN row.build_flags.split().sort() ; PROCESS img ; END %]</td>
+    <td class="tests">[% FOREACH test IN row.log_text.keys.nsort ; r = row.log_text.$test ; PROCESS test_result ; END %]</td>
 </tr>
 [% END %]
     </table>