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. And don't claim there are no errors when the task has not run yet.
Signed-off-by: Francois Gouget fgouget@codeweavers.com --- testbot/web/JobDetails.pl | 59 ++++++++++++++++++++++++++++++++----- testbot/web/WineTestBot.css | 1 + 2 files changed, 53 insertions(+), 7 deletions(-)
diff --git a/testbot/web/JobDetails.pl b/testbot/web/JobDetails.pl index ccf3410f5b..5a484da362 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,16 +556,18 @@ EOF { next if ($LogName =~ /^old_/); my $LogInfo = LoadLogErrors("$TaskDir/$LogName"); - next if (!$LogInfo->{ErrCount}); - $LogInfos->{$LogName} = $LogInfo; + if ($LogInfo->{ErrCount} or defined $LogInfo->{BadLog}) + { + $LogInfos->{$LogName} = $LogInfo; + } } my $ShowLogName = ($ReportCount > 1 or scalar(keys %$LogInfos) > 1);
- my $LogIsEmpty = 1; + my $NoErrors = 1; foreach my $LogName (@{$MoreInfo->{Logs}}) { next if (!$LogInfos->{$LogName}); - $LogIsEmpty = 0; + $NoErrors = 0;
if ($ShowLogName) { @@ -554,6 +577,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" if ($GroupName); @@ -576,9 +617,9 @@ EOF print "</code></pre>\n"; } } - - if ($LogIsEmpty) + if (!@{$MoreInfo->{Logs}}) { + # There is no log file or they are all empty if ($StepTask->Status eq "canceled") { print "No log, task was canceled\n"; @@ -589,9 +630,13 @@ EOF } else { - print "No errors\n"; + print "<pre class='log-note'>No result yet...</pre>\n"; } } + elsif ($NoErrors) + { + print "No errors\n"; + } } } print "</div>\n"; diff --git a/testbot/web/WineTestBot.css b/testbot/web/WineTestBot.css index 9a23f5fa82..3fccbd2652 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; }