[21/25] testbot/JobDetails: Improve the error reporting.

Francois Gouget fgouget at codeweavers.com
Tue Jan 14 09:43:11 CST 2020


Clearly indicate when the log or its errors cache could not be read.
Also show a note when new errors could not be detected, either because
there is no reference WineTest results (which would typically happen
shortly after a new test configuration has been added), or because there
was an issue reading one or more of the reference reports.
---
 testbot/web/JobDetails.pl   | 46 +++++++++++++++++++++++++++++++++++--
 testbot/web/WineTestBot.css |  1 +
 2 files changed, 45 insertions(+), 2 deletions(-)

diff --git a/testbot/web/JobDetails.pl b/testbot/web/JobDetails.pl
index eee8df2df..7fc90bf20 100644
--- a/testbot/web/JobDetails.pl
+++ b/testbot/web/JobDetails.pl
@@ -351,6 +351,22 @@ sub GenerateFullLog($$$$)
   my ($self, $Dir, $LogName, $HideLog) = @_;
 
   my $LogInfo = LoadLogErrors("$Dir/$LogName");
+  if (defined $LogInfo->{BadLog})
+  {
+    print "<pre class='log-note'>Could not highlight new errors: ", ($LogInfo->{BadRef} || $LogInfo->{BadLog}), "</pre>\n";
+  }
+  elsif ($LogInfo->{NoRef} and !defined $LogInfo->{BadRef})
+  {
+    print "<pre class='log-note'>No WineTest results are available to detect new errors</pre>\n";
+  }
+  elsif ($LogInfo->{NoRef})
+  {
+    print "<pre class='log-note'>Could not detect new errors: $LogInfo->{BadRef}</pre>\n";
+  }
+  elsif (defined $LogInfo->{BadRef})
+  {
+    print "<pre class='log-note'>Some WineTest results could not be used to detect new errors: $LogInfo->{BadRef}</pre>\n";
+  }
 
   my %NewLineNos;
   if ($LogInfo->{ErrCount})
@@ -397,6 +413,11 @@ sub GenerateFullLog($$$$)
     }
     close($LogFile);
   }
+  else
+  {
+    print "<pre class='log-error'><code>Unable to open '$LogName' for reading: $!</code></pre>\n";
+    $IsEmpty = 0;
+  }
 
   # And append the extra errors
   foreach my $GroupName (@{$LogInfo->{ErrGroupNames}})
@@ -535,8 +556,11 @@ EOF
       {
         next if ($LogName =~ /^old_/);
         my $LogInfo = LoadLogErrors("$TaskDir/$LogName");
-        next if (!$LogInfo->{ErrCount});
-        $LogInfos->{$LogName} = $LogInfo;
+        if ($LogInfo->{ErrCount} or
+            (defined $LogInfo->{BadLog} and !-z "$TaskDir/$LogName"))
+        {
+          $LogInfos->{$LogName} = $LogInfo;
+        }
       }
       my $ShowLogName = ($ReportCount > 1 or scalar(keys %$LogInfos) > 1);
 
@@ -554,6 +578,24 @@ EOF
         }
 
         my $LogInfo = $LogInfos->{$LogName};
+        if (defined $LogInfo->{BadLog})
+        {
+          my ($_Action, $Url) = $self->GetMoreInfoLink($Key, GetLogLabel($LogName), "Full", $LogName);
+          print "<pre class='log-note'>The error summary is not available (<a href='$Url'>see full log instead</a>): $LogInfo->{BadLog}</pre>\n";
+        }
+        elsif ($LogInfo->{NoRef} and !defined $LogInfo->{BadRef})
+        {
+          print "<pre class='log-note'>No WineTest results are available to detect new errors</pre>\n";
+        }
+        elsif ($LogInfo->{NoRef})
+        {
+          print "<pre class='log-note'>Could not detect new errors: $LogInfo->{BadRef}</pre>\n";
+        }
+        elsif (defined $LogInfo->{BadRef})
+        {
+          print "<pre class='log-note'>Some WineTest results could not be used to detect new errors: $LogInfo->{BadRef}</pre>\n";
+        }
+
         foreach my $GroupName (@{$LogInfo->{ErrGroupNames}})
         {
           print "<div class='LogDllName'>$GroupName</div>\n";
diff --git a/testbot/web/WineTestBot.css b/testbot/web/WineTestBot.css
index 9a23f5fa8..3fccbd265 100644
--- a/testbot/web/WineTestBot.css
+++ b/testbot/web/WineTestBot.css
@@ -395,6 +395,7 @@ pre
 .userdisabled { color: red; }
 .userdeleted  { color: red; }
 
+.log-note  { font-style: italic; color: blue; }
 .log-info  { background-color: #d9ffcc; }
 .log-skip  { color: blue; }
 .log-todo  { color: #d08000; }
-- 
2.20.1




More information about the wine-devel mailing list