Francois Gouget : testbot: Check for 32/ 64 bit VMs before creating the WineTest Job.

Alexandre Julliard julliard at winehq.org
Mon Jun 4 15:43:21 CDT 2018


Module: tools
Branch: master
Commit: 90bb7e899321d87b6564c2a0e9346c78909c3617
URL:    https://source.winehq.org/git/tools.git/?a=commit;h=90bb7e899321d87b6564c2a0e9346c78909c3617

Author: Francois Gouget <fgouget at codeweavers.com>
Date:   Mon Jun  4 10:21:57 2018 +0200

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

Signed-off-by: Francois Gouget <fgouget at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 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 ff8c30c..20eacec 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)
   {




More information about the wine-cvs mailing list