Add testcases detail column to status page
[buildfarm-server.git] / cgi-bin / show_status.pl
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;