[PATCH] testbot: Check for 32/64 bit VMs before creating the WineTest Job.

Francois Gouget fgouget at codeweavers.com
Mon Jun 4 03:21:57 CDT 2018


Signed-off-by: Francois Gouget <fgouget at codeweavers.com>
---
 testbot/bin/CheckForWinetestUpdate.pl | 46 +++++++++++++--------------
 1 file changed, 22 insertions(+), 24 deletions(-)

diff --git a/testbot/bin/CheckForWinetestUpdate.pl b/testbot/bin/CheckForWinetestUpdate.pl
index ff8c30c23..20eacec63 100755
--- a/testbot/bin/CheckForWinetestUpdate.pl
+++ b/testbot/bin/CheckForWinetestUpdate.pl
@@ -65,6 +65,28 @@ sub AddJob($$$)
 {
   my ($BaseJob, $LatestBaseName, $Bits) = @_;
 
+  my $VMs = CreateVMs();
+  if ($Bits == 64)
+  {
+    $VMs->AddFilter("Type", ["win64"]);
+    $VMs->AddFilter("Role", ["base", "winetest"]);
+  }
+  elsif ($BaseJob)
+  {
+    $VMs->AddFilter("Type", ["win32", "win64"]);
+    $VMs->AddFilter("Role", ["base"]);
+  }
+  else
+  {
+    $VMs->AddFilter("Type", ["win32", "win64"]);
+    $VMs->AddFilter("Role", ["winetest"]);
+  }
+  if ($VMs->GetItemsCount() == 0)
+  {
+    # There is nothing to do
+    return 1;
+  }
+
   # Create a hard link in staging so it can then be moved into the job
   # directory. This is ok because the latest file is never overwritten.
   my $StagingFileName = CreateNewLink("$DataDir/latest/$LatestBaseName",
@@ -90,38 +112,14 @@ sub AddJob($$$)
 
   # Add a task for each VM
   my $Tasks = $NewStep->Tasks;
-  my $HasTasks = !1;
-  my $VMs = CreateVMs();
-  if ($Bits == 64)
-  {
-    $VMs->AddFilter("Type", ["win64"]);
-    $VMs->AddFilter("Role", ["base", "winetest"]);
-  }
-  elsif ($BaseJob)
-  {
-    $VMs->AddFilter("Type", ["win32", "win64"]);
-    $VMs->AddFilter("Role", ["base"]);
-  }
-  else
-  {
-    $VMs->AddFilter("Type", ["win32", "win64"]);
-    $VMs->AddFilter("Role", ["winetest"]);
-  }
   foreach my $VMKey (@{$VMs->SortKeysBySortOrder($VMs->GetKeys())})
   {
     my $Task = $Tasks->Add();
     $Task->VM($VMs->GetItem($VMKey));
     $Task->Timeout($SuiteTimeout);
-    $HasTasks = 1;
   }
 
   # Now save the whole thing
-  if (!$HasTasks)
-  {
-    unlink($StagingFileName);
-    return 1;
-  }
-
   my ($ErrKey, $ErrProperty, $ErrMessage) = $Jobs->Save();
   if (defined $ErrMessage)
   {
-- 
2.17.0



More information about the wine-devel mailing list