Module: tools
Branch: master
Commit: 380f273d7b48561c6b41c8583f55083246bb1728
URL: https://source.winehq.org/git/tools.git/?a=commit;h=380f273d7b48561c6b41c85…
Author: Francois Gouget <fgouget(a)codeweavers.com>
Date: Thu Jun 21 14:35:29 2018 +0200
testbot/WineRunTask: Rename the Windows test reports.
Keep 'log' for the task log messages (such as the compilation log) and
store the actual (WineTest) test report in '.report' files.
Signed-off-by: Francois Gouget <fgouget(a)codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard(a)winehq.org>
---
testbot/bin/WineRunTask.pl | 16 ++++++++--------
testbot/web/JobDetails.pl | 9 ++++++---
2 files changed, 14 insertions(+), 11 deletions(-)
diff --git a/testbot/bin/WineRunTask.pl b/testbot/bin/WineRunTask.pl
index 7f92b88..3f5a3ee 100755
--- a/testbot/bin/WineRunTask.pl
+++ b/testbot/bin/WineRunTask.pl
@@ -195,7 +195,7 @@ my $OldUMask = umask(002);
my $TaskDir = $Task->CreateDir();
umask($OldUMask);
my $VM = $Task->VM;
-my $RptFileName = $VM->Name . ".rpt";
+my $RptFileName = $Step->FileType .".report";
my $Start = Time();
@@ -292,13 +292,13 @@ sub WrapUpAndExit($;$$$)
if ($Step->Type eq 'suite' and $Status eq 'completed' and !$TimedOut)
{
# Keep the old report if the new one is missing
- if (-f "$TaskDir/log" and !-z "$TaskDir/log")
+ if (-f "$TaskDir/$RptFileName" and !-z "$TaskDir/$RptFileName")
{
# Update the reference VM suite results for WineSendLog.pl
my $LatestBaseName = join("", "$DataDir/latest/", $Task->VM->Name, "_",
$Step->FileType eq "exe64" ? "64" : "32");
unlink("$LatestBaseName.log");
- link("$TaskDir/log", "$LatestBaseName.log");
+ link("$TaskDir/$RptFileName", "$LatestBaseName.log");
unlink("$LatestBaseName.err");
if (-f "$TaskDir/err" and !-z "$TaskDir/err")
{
@@ -518,11 +518,11 @@ if (!defined $TA->Wait($Pid, $Timeout, $Keepalive))
}
my $TimedOut;
-Debug(Elapsed($Start), " Retrieving the report file to 'log'\n");
-if ($TA->GetFile($RptFileName, "$TaskDir/log"))
+Debug(Elapsed($Start), " Retrieving the report file to '$RptFileName'\n");
+if ($TA->GetFile($RptFileName, "$TaskDir/$RptFileName"))
{
- chmod 0664, "$TaskDir/log";
- if (open(my $LogFile, "<", "$TaskDir/log"))
+ chmod 0664, "$TaskDir/$RptFileName";
+ if (open(my $LogFile, "<", "$TaskDir/$RptFileName"))
{
# There is more than one test unit when running the full test suite so keep
# track of the current one. Note that for the TestBot we don't count or
@@ -788,7 +788,7 @@ if ($TA->GetFile($RptFileName, "$TaskDir/log"))
else
{
$NewStatus = 'boterror';
- Error "Unable to open 'log' for reading: $!\n";
+ Error "Unable to open '$RptFileName' for reading: $!\n";
LogTaskError("Unable to open the log file for reading: $!\n");
}
}
diff --git a/testbot/web/JobDetails.pl b/testbot/web/JobDetails.pl
index 410d186..f05c0f6 100644
--- a/testbot/web/JobDetails.pl
+++ b/testbot/web/JobDetails.pl
@@ -283,9 +283,12 @@ sub GetHtmlLine($$$)
return (undef, $Line);
}
+my @MILogFiles = qw(exe32.report exe64.report log log.old);
my %MILogLabels = (
- "log" => "task log",
- "log.old" => "old logs",
+ "exe32.report" => "32 bit Windows report",
+ "exe64.report" => "64 bit Windows report",
+ "log" => "task log",
+ "log.old" => "old logs",
);
sub InitMoreInfo($)
@@ -301,7 +304,7 @@ sub InitMoreInfo($)
my $Value = $self->GetParam("f$Key");
my $TaskDir = $StepTask->GetTaskDir();
- foreach my $Log ("log", "log.old")
+ foreach my $Log (@MILogFiles)
{
if (!-f "$TaskDir/$Log" or -z "$TaskDir/$Log")
{
Module: tools
Branch: master
Commit: 8c0549a75712141c92be90a6cc92a6e8d8b8e1bb
URL: https://source.winehq.org/git/tools.git/?a=commit;h=8c0549a75712141c92be90a…
Author: Francois Gouget <fgouget(a)codeweavers.com>
Date: Thu Jun 21 14:32:23 2018 +0200
testbot/WineRunTask: Preserve the old WineTest report in case of timeout.
If the task timed out the new report is likely quite incomplete and thus
would be a poor substitute for the existing reference WineTest report.
Signed-off-by: Francois Gouget <fgouget(a)codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard(a)winehq.org>
---
testbot/bin/WineRunTask.pl | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/testbot/bin/WineRunTask.pl b/testbot/bin/WineRunTask.pl
index ed19034..7f92b88 100755
--- a/testbot/bin/WineRunTask.pl
+++ b/testbot/bin/WineRunTask.pl
@@ -289,7 +289,7 @@ sub WrapUpAndExit($;$$$)
$VM->Save();
}
- if ($Status eq 'completed' and $Step->Type eq 'suite')
+ if ($Step->Type eq 'suite' and $Status eq 'completed' and !$TimedOut)
{
# Keep the old report if the new one is missing
if (-f "$TaskDir/log" and !-z "$TaskDir/log")
Module: tools
Branch: master
Commit: 4737be4cefd50cd483925731a9a79611a05b3314
URL: https://source.winehq.org/git/tools.git/?a=commit;h=4737be4cefd50cd48392573…
Author: Francois Gouget <fgouget(a)codeweavers.com>
Date: Thu Jun 21 14:32:08 2018 +0200
testbot/WineRunTask: Keep the old reference report if the new one is missing.
The WineTest results usually don't change too much from one run to the
next so it's better to have a slightly out of date report than nothing
at all.
Signed-off-by: Francois Gouget <fgouget(a)codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard(a)winehq.org>
---
testbot/bin/WineRunTask.pl | 21 ++++++++++++++-------
1 file changed, 14 insertions(+), 7 deletions(-)
diff --git a/testbot/bin/WineRunTask.pl b/testbot/bin/WineRunTask.pl
index c4ca578..ed19034 100755
--- a/testbot/bin/WineRunTask.pl
+++ b/testbot/bin/WineRunTask.pl
@@ -291,13 +291,20 @@ sub WrapUpAndExit($;$$$)
if ($Status eq 'completed' and $Step->Type eq 'suite')
{
- # Update the reference VM suite results for WineSendLog.pl
- my $LatestBaseName = join("", "$DataDir/latest/", $Task->VM->Name, "_",
- $Step->FileType eq "exe64" ? "64" : "32");
- unlink("$LatestBaseName.log");
- link("$TaskDir/log", "$LatestBaseName.log") if (-f "$TaskDir/log");
- unlink("$LatestBaseName.err");
- link("$TaskDir/err", "$LatestBaseName.err") if (-f "$TaskDir/err");
+ # Keep the old report if the new one is missing
+ if (-f "$TaskDir/log" and !-z "$TaskDir/log")
+ {
+ # Update the reference VM suite results for WineSendLog.pl
+ my $LatestBaseName = join("", "$DataDir/latest/", $Task->VM->Name, "_",
+ $Step->FileType eq "exe64" ? "64" : "32");
+ unlink("$LatestBaseName.log");
+ link("$TaskDir/log", "$LatestBaseName.log");
+ unlink("$LatestBaseName.err");
+ if (-f "$TaskDir/err" and !-z "$TaskDir/err")
+ {
+ link("$TaskDir/err", "$LatestBaseName.err");
+ }
+ }
}
my $Result = $VM->Name .": ". $VM->Status ." Status: $Status Failures: ". (defined $TestFailures ? $TestFailures : "unset");
Module: tools
Branch: master
Commit: 6a2445a55a0021bb193be98fd4a63d6772ca8796
URL: https://source.winehq.org/git/tools.git/?a=commit;h=6a2445a55a0021bb193be98…
Author: Francois Gouget <fgouget(a)codeweavers.com>
Date: Thu Jun 21 14:31:18 2018 +0200
testbot/WineRun*: Don't duplicate errors and factorize the log parsing.
Move the task log parsing functions to LogUtils.pm so the WineRun*.pl
scripts can share them.
Also stop copying the 'Build: *' result lines from the log to the err
file. It's up to the GUI to present all the relevant lines when only
showing the log summary (which it does now).
Finally, there is nothing for the script to do if the patch fails to
apply. So even if we did not get the full log or the task timed out
somehow, the status of the task should be 'badpatch' and the other
errors don't matter.
Signed-off-by: Francois Gouget <fgouget(a)codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard(a)winehq.org>
---
testbot/bin/WineRunBuild.pl | 49 ++++++++++-------------
testbot/bin/WineRunReconfig.pl | 49 +++++++----------------
testbot/lib/WineTestBot/LogUtils.pm | 77 +++++++++++++++++++++++++++++++++++++
3 files changed, 111 insertions(+), 64 deletions(-)
diff --git a/testbot/bin/WineRunBuild.pl b/testbot/bin/WineRunBuild.pl
index 1bc6cff..60af32c 100755
--- a/testbot/bin/WineRunBuild.pl
+++ b/testbot/bin/WineRunBuild.pl
@@ -46,6 +46,7 @@ use WineTestBot::Jobs;
use WineTestBot::PatchUtils;
use WineTestBot::VMs;
use WineTestBot::Log;
+use WineTestBot::LogUtils;
use WineTestBot::Engine::Notify;
@@ -391,39 +392,29 @@ if (!defined $TA->Wait($Pid, $Task->Timeout, 60))
Debug(Elapsed($Start), " Retrieving 'Build.log'\n");
if ($TA->GetFile("Build.log", "$TaskDir/log"))
{
- if (open(my $LogFile, "<", "$TaskDir/log"))
+ my $Result = ParseTaskLog("$TaskDir/log", "Build");
+ if ($Result eq "ok")
{
- # Collect and analyze the 'Build:' status line(s)
- $ErrMessage ||= "";
- foreach my $Line (<$LogFile>)
- {
- chomp($Line);
- next if ($Line !~ /^Build: (.*)$/);
- if ($1 eq "ok")
- {
- # We must have gotten the full log and the build did succeed.
- # So forget any prior error.
- $NewStatus = "completed";
- $TAError = $ErrMessage = undef;
- }
- else
- {
- $NewStatus = ($1 eq "Patch failed to apply") ? "badpatch" : "badbuild";
- # Collect all the build errors (32 bit, 64 bit, etc)
- $ErrMessage .= "$1\n";
- }
- }
- close($LogFile);
-
- if (!defined $NewStatus)
- {
- $NewStatus = "badbuild";
- $ErrMessage = "Missing build status line\n";
- }
+ # We must have gotten the full log and the build did succeed.
+ # So forget any prior error.
+ $NewStatus = "completed";
+ $TAError = $ErrMessage = undef;
+ }
+ elsif ($Result eq "badpatch")
+ {
+ # This too is conclusive enough to ignore other errors.
+ $NewStatus = "badpatch";
+ $TAError = $ErrMessage = undef;
+ }
+ elsif ($Result =~ s/^nolog://)
+ {
+ FatalError("$Result\n", "retry");
}
else
{
- FatalError("Unable to open the build log for reading: $!\n", "retry");
+ # If the result line is missing we probably already have an error message
+ # that explains why.
+ $NewStatus = "badbuild";
}
}
elsif (!defined $TAError)
diff --git a/testbot/bin/WineRunReconfig.pl b/testbot/bin/WineRunReconfig.pl
index d04b780..2950799 100755
--- a/testbot/bin/WineRunReconfig.pl
+++ b/testbot/bin/WineRunReconfig.pl
@@ -45,6 +45,7 @@ use WineTestBot::Config;
use WineTestBot::Jobs;
use WineTestBot::VMs;
use WineTestBot::Log;
+use WineTestBot::LogUtils;
use WineTestBot::Engine::Notify;
@@ -373,45 +374,23 @@ if (!defined $TA->Wait($Pid, $Task->Timeout, 60))
Debug(Elapsed($Start), " Retrieving 'Reconfig.log'\n");
if ($TA->GetFile("Reconfig.log", "$TaskDir/log"))
{
- if (open(my $LogFile, "<", "$TaskDir/log"))
+ my $Result = ParseTaskLog("$TaskDir/log", "Reconfig");
+ if ($Result eq "ok")
{
- # Collect and analyze the 'Reconfig:' status line(s).
- my $LogErrors;
- foreach my $Line (<$LogFile>)
- {
- chomp($Line);
- next if ($Line !~ /^Reconfig: (.*)$/);
- # Add the error message or an empty string for 'ok'
- $LogErrors = ($LogErrors || "") . ($1 ne "ok" ? "$1\n" : "");
- }
- close($LogFile);
-
- if (!defined $LogErrors)
- {
- if (!defined $ErrMessage)
- {
- $NewStatus = "badbuild";
- $ErrMessage = "Missing reconfig status line\n";
- }
- # otherwise $ErrMessage probably already explains why the reconfig
- # status line is missing
- }
- elsif ($LogErrors eq "")
- {
- # We must have gotten the full log and the build did succeed.
- # So forget any prior error.
- $NewStatus = "completed";
- $TAError = $ErrMessage = undef;
- }
- else
- {
- $NewStatus = "badbuild";
- $ErrMessage = $LogErrors . ($ErrMessage || "");
- }
+ # We must have gotten the full log and the build did succeed.
+ # So forget any prior error.
+ $NewStatus = "completed";
+ $TAError = $ErrMessage = undef;
+ }
+ elsif ($Result =~ s/^nolog://)
+ {
+ FatalError("$Result\n", "retry");
}
else
{
- FatalError("Unable to open the build log for reading: $!\n");
+ # We should not have badpatch errors and if the result line is missing we
+ # probably already have an error message that explains why.
+ $NewStatus = "badbuild";
}
}
elsif (!defined $TAError)
diff --git a/testbot/lib/WineTestBot/LogUtils.pm b/testbot/lib/WineTestBot/LogUtils.pm
new file mode 100644
index 0000000..3e40fbc
--- /dev/null
+++ b/testbot/lib/WineTestBot/LogUtils.pm
@@ -0,0 +1,77 @@
+# -*- Mode: Perl; perl-indent-level: 2; indent-tabs-mode: nil -*-
+# Copyright 2018 Francois Gouget
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+
+use strict;
+
+package WineTestBot::LogUtils;
+
+=head1 NAME
+
+WineTestBot::LogUtils - Provides functions to parse task logs
+
+=cut
+
+
+use Exporter 'import';
+our @EXPORT = qw(ParseTaskLog);
+
+
+#
+# Task log parser
+#
+
+=pod
+=over 12
+
+=item C<ParseTaskLog()>
+
+Returns ok if the task was successful and an error code otherwise.
+
+=back
+=cut
+
+sub ParseTaskLog($$)
+{
+ my ($FileName, $ResultPrefix) = @_;
+
+ if (open(my $LogFile, "<", $FileName))
+ {
+ my $Result;
+ foreach my $Line (<$LogFile>)
+ {
+ chomp $Line;
+ if ($Line =~ /^$ResultPrefix: ok$/)
+ {
+ $Result ||= "ok";
+ }
+ elsif ($Line =~ /^$ResultPrefix: Patch failed to apply$/)
+ {
+ $Result = "badpatch";
+ last; # Should be the last and most specific message
+ }
+ elsif ($Line =~ /^$ResultPrefix: /)
+ {
+ $Result = "failed";
+ }
+ }
+ close($LogFile);
+ return $Result || "missing";
+ }
+ return "nolog:Unable to open the task log for reading: $!";
+}
+
+1;