Francois Gouget : testbot: Return log access errors in the BadLog field for ParseWineTestRepor().
Alexandre Julliard
julliard at winehq.org
Mon Jan 27 14:14:28 CST 2020
Module: tools
Branch: master
Commit: 698fee7468e001789638d6a60aa6d81a36511427
URL: https://source.winehq.org/git/tools.git/?a=commit;h=698fee7468e001789638d6a60aa6d81a36511427
Author: Francois Gouget <fgouget at codeweavers.com>
Date: Mon Jan 27 03:29:31 2020 +0100
testbot: Return log access errors in the BadLog field for ParseWineTestRepor().
This makes diagnosis easier for the ParseWineTestRepor() callers and
matches ParseTaskLog().
Signed-off-by: Francois Gouget <fgouget at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
testbot/bin/UpdateTaskLogs | 5 +----
testbot/bin/WineRunTask.pl | 6 +++---
testbot/bin/WineRunWineTest.pl | 6 +++---
testbot/lib/WineTestBot/LogUtils.pm | 5 ++++-
4 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/testbot/bin/UpdateTaskLogs b/testbot/bin/UpdateTaskLogs
index 00a6f23..f5205f2 100755
--- a/testbot/bin/UpdateTaskLogs
+++ b/testbot/bin/UpdateTaskLogs
@@ -191,10 +191,7 @@ sub BuildErrFile($$$$)
my $TaskKey = Path2TaskKey($Dir);
my $LogInfo = ParseWineTestReport("$Dir/$ReportName", $IsWineTest, $TaskTimedOut);
- if (!defined $LogInfo->{Failures} and @{$LogInfo->{Extra}} == 1)
- {
- return "$TaskKey: $LogInfo->{Extra}->[0]";
- }
+ return "$TaskKey: $LogInfo->{BadLog}" if (defined $LogInfo->{BadLog});
return undef if (!@{$LogInfo->{Extra}});
Debug("$TaskKey: Creating $ReportName.err\n");
diff --git a/testbot/bin/WineRunTask.pl b/testbot/bin/WineRunTask.pl
index 3044cd7..7c8c570 100755
--- a/testbot/bin/WineRunTask.pl
+++ b/testbot/bin/WineRunTask.pl
@@ -558,12 +558,12 @@ if ($TA->GetFile($RptFileName, "$TaskDir/$RptFileName"))
my $LogInfo = ParseWineTestReport("$TaskDir/$RptFileName", $IsWineTest, $TaskTimedOut);
$TaskTimedOut = 1 if ($LogInfo->{TestUnitCount} == $LogInfo->{TimeoutCount});
- if (!defined $LogInfo->{Failures} and @{$LogInfo->{Extra}} == 1)
+ if (defined $LogInfo->{BadLog})
{
# Could not open the file
$NewStatus = 'boterror';
- Error "$LogInfo->{Extra}->[0]\n";
- LogTaskError("$LogInfo->{Extra}->[0]\n");
+ Error "$LogInfo->{BadLog}\n";
+ LogTaskError("$LogInfo->{BadLog}\n");
}
else
{
diff --git a/testbot/bin/WineRunWineTest.pl b/testbot/bin/WineRunWineTest.pl
index 696e27e..6ca1d28 100755
--- a/testbot/bin/WineRunWineTest.pl
+++ b/testbot/bin/WineRunWineTest.pl
@@ -580,12 +580,12 @@ foreach my $Mission (@{$TaskMissions->{Missions}})
my $LogInfo = ParseWineTestReport("$TaskDir/$RptFileName", $Step->FileType eq "patch", $TaskTimedOut);
$TaskTimedOut = 1 if ($LogInfo->{TestUnitCount} == $LogInfo->{TimeoutCount});
- if (!defined $LogInfo->{Failures} and @{$LogInfo->{Extra}} == 1)
+ if (defined $LogInfo->{BadLog})
{
# Could not open the file
$NewStatus = 'boterror';
- Error "$LogInfo->{Extra}->[0]\n";
- LogTaskError("$LogInfo->{Extra}->[0]\n");
+ Error "$LogInfo->{BadLog}\n";
+ LogTaskError("$LogInfo->{BadLog}\n");
}
else
{
diff --git a/testbot/lib/WineTestBot/LogUtils.pm b/testbot/lib/WineTestBot/LogUtils.pm
index 96840eb..9aa2e81 100644
--- a/testbot/lib/WineTestBot/LogUtils.pm
+++ b/testbot/lib/WineTestBot/LogUtils.pm
@@ -353,6 +353,9 @@ The number of failed tests.
=item Extra
An array containing the extra errors detected during the inconsistency check.
+=item BadLog
+Contains an error message if the report could not be read.
+
=back
=back
=cut
@@ -365,7 +368,7 @@ sub ParseWineTestReport($$$)
if (!open($LogFile, "<", $FileName))
{
my $LogName = basename($FileName);
- return {Extra => ["Unable to open '$LogName' for reading: $!"]};
+ return {BadLog => "Unable to open '$LogName' for reading: $!"};
}
my $LogInfo = {
More information about the wine-cvs
mailing list