[PATCH] testbot: Remove support for the old task status lines.

Francois Gouget fgouget at codeweavers.com
Thu Aug 23 03:46:29 CDT 2018


Note that there is no need to wait for all task logs to be in the new 
format because ParseTaskLog() is only called when a new task completes.

Signed-off-by: Francois Gouget <fgouget at codeweavers.com>
---
 testbot/bin/WineRunBuild.pl         |  2 +-
 testbot/bin/WineRunReconfig.pl      |  2 +-
 testbot/bin/WineRunWineTest.pl      |  2 +-
 testbot/lib/WineTestBot/LogUtils.pm | 10 +++++-----
 4 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/testbot/bin/WineRunBuild.pl b/testbot/bin/WineRunBuild.pl
index 2c5fbfa29..b246164e5 100755
--- a/testbot/bin/WineRunBuild.pl
+++ b/testbot/bin/WineRunBuild.pl
@@ -406,7 +406,7 @@ if (!defined $TA->Wait($Pid, $Task->Timeout, 60))
 Debug(Elapsed($Start), " Retrieving 'Build.log'\n");
 if ($TA->GetFile("Build.log", "$TaskDir/log"))
 {
-  my $Result = ParseTaskLog("$TaskDir/log", "Build");
+  my $Result = ParseTaskLog("$TaskDir/log");
   if ($Result eq "ok")
   {
     # We must have gotten the full log and the build did succeed.
diff --git a/testbot/bin/WineRunReconfig.pl b/testbot/bin/WineRunReconfig.pl
index b45dba5c7..3fec02b89 100755
--- a/testbot/bin/WineRunReconfig.pl
+++ b/testbot/bin/WineRunReconfig.pl
@@ -388,7 +388,7 @@ if (!defined $TA->Wait($Pid, $Task->Timeout, 60))
 Debug(Elapsed($Start), " Retrieving 'Reconfig.log'\n");
 if ($TA->GetFile("Reconfig.log", "$TaskDir/log"))
 {
-  my $Result = ParseTaskLog("$TaskDir/log", "Reconfig");
+  my $Result = ParseTaskLog("$TaskDir/log");
   if ($Result eq "ok")
   {
     # We must have gotten the full log and the build did succeed.
diff --git a/testbot/bin/WineRunWineTest.pl b/testbot/bin/WineRunWineTest.pl
index 216811116..2552a7c9d 100755
--- a/testbot/bin/WineRunWineTest.pl
+++ b/testbot/bin/WineRunWineTest.pl
@@ -499,7 +499,7 @@ if (!defined $TA->Wait($Pid, $Task->Timeout, 60))
 Debug(Elapsed($Start), " Retrieving 'Task.log'\n");
 if ($TA->GetFile("Task.log", "$TaskDir/log"))
 {
-  my $Result = ParseTaskLog("$TaskDir/log", "Task");
+  my $Result = ParseTaskLog("$TaskDir/log");
   if ($Result eq "ok")
   {
     # We must have gotten the full log and the build did succeed.
diff --git a/testbot/lib/WineTestBot/LogUtils.pm b/testbot/lib/WineTestBot/LogUtils.pm
index d39c81b38..e05afb605 100644
--- a/testbot/lib/WineTestBot/LogUtils.pm
+++ b/testbot/lib/WineTestBot/LogUtils.pm
@@ -50,9 +50,9 @@ Returns ok if the task was successful and an error code otherwise.
 =back
 =cut
 
-sub ParseTaskLog($$)
+sub ParseTaskLog($)
 {
-  my ($FileName, $ResultPrefix) = @_;
+  my ($FileName) = @_;
 
   if (open(my $LogFile, "<", $FileName))
   {
@@ -60,16 +60,16 @@ sub ParseTaskLog($$)
     foreach my $Line (<$LogFile>)
     {
       chomp $Line;
-      if ($Line =~ /^(?:$ResultPrefix|Task): ok$/)
+      if ($Line =~ /^Task: ok$/)
       {
         $Result ||= "ok";
       }
-      elsif ($Line =~ /^(?:$ResultPrefix|Task): Patch failed to apply$/)
+      elsif ($Line =~ /^Task: Patch failed to apply$/)
       {
         $Result = "badpatch";
         last; # Should be the last and most specific message
       }
-      elsif ($Line =~ /^(?:$ResultPrefix|Task): /)
+      elsif ($Line =~ /^Task: /)
       {
         $Result = "failed";
       }
-- 
2.18.0




More information about the wine-devel mailing list