The log file may exist but not be readable. This makes it consistent with the BadRef / NoRef terminology of TagNewErrors(). Also don't assume that the error message will evaluate to true.
Signed-off-by: Francois Gouget fgouget@codeweavers.com --- testbot/bin/WineRunBuild.pl | 4 ++-- testbot/bin/WineRunReconfig.pl | 4 ++-- testbot/bin/WineRunWineTest.pl | 4 ++-- testbot/lib/WineTestBot/LogUtils.pm | 5 +++-- 4 files changed, 9 insertions(+), 8 deletions(-)
diff --git a/testbot/bin/WineRunBuild.pl b/testbot/bin/WineRunBuild.pl index cf6428ae4a..9fc5bffe24 100755 --- a/testbot/bin/WineRunBuild.pl +++ b/testbot/bin/WineRunBuild.pl @@ -433,9 +433,9 @@ if ($TA->GetFile("Build.log", "$TaskDir/log")) $NewStatus = "badpatch"; $TAError = $ErrMessage = undef; } - elsif ($LogInfo->{NoLog}) + elsif (defined $LogInfo->{BadLog}) { - FatalError("$LogInfo->{NoLog}\n", "retry"); + FatalError("$LogInfo->{BadLog}\n", "retry"); } else { diff --git a/testbot/bin/WineRunReconfig.pl b/testbot/bin/WineRunReconfig.pl index c16c40a5af..f56d64ae55 100755 --- a/testbot/bin/WineRunReconfig.pl +++ b/testbot/bin/WineRunReconfig.pl @@ -428,9 +428,9 @@ if ($TA->GetFile("Reconfig.log", "$TaskDir/log")) $NewStatus = "completed"; $TAError = $ErrMessage = undef; } - elsif ($LogInfo->{NoLog}) + elsif (defined $LogInfo->{BadLog}) { - FatalError("$LogInfo->{NoLog}\n", "retry"); + FatalError("$LogInfo->{BadLog}\n", "retry"); } else { diff --git a/testbot/bin/WineRunWineTest.pl b/testbot/bin/WineRunWineTest.pl index 950661b70c..696e27e7a8 100755 --- a/testbot/bin/WineRunWineTest.pl +++ b/testbot/bin/WineRunWineTest.pl @@ -542,9 +542,9 @@ if ($TA->GetFile("Task.log", "$TaskDir/log")) $NewStatus = "badpatch"; $TaskFailures = $TAError = $ErrMessage = $PossibleCrash = undef; } - elsif ($LogInfo->{NoLog}) + elsif (defined $LogInfo->{BadLog}) { - FatalError("$LogInfo->{NoLog}\n", "retry"); + FatalError("$LogInfo->{BadLog}\n", "retry"); } elsif ($LogInfo->{Type} eq "build") { diff --git a/testbot/lib/WineTestBot/LogUtils.pm b/testbot/lib/WineTestBot/LogUtils.pm index 81cff51af8..96840eba58 100644 --- a/testbot/lib/WineTestBot/LogUtils.pm +++ b/testbot/lib/WineTestBot/LogUtils.pm @@ -81,7 +81,7 @@ Either 'ok' if the task was successful or a code indicating why it failed. Entries named after the binaries and files of interest to the TestBot that have been updated.
-=item NoLog +=item BadLog Contains an error message if the task log could not be read.
=back @@ -95,7 +95,8 @@ sub ParseTaskLog($) my $LogFile; if (!open($LogFile, "<", $FileName)) { - return {NoLog => "Unable to open the task log for reading: $!"}; + my $LogName = basename($FileName); + return {BadLog => "Unable to open '$LogName' for reading: $!"}; }
my $LogInfo = {Type => "build"};