Francois Gouget : testbot/web: Only create a build step if there are VMs that need it.

Alexandre Julliard julliard at winehq.org
Thu Jun 14 16:22:03 CDT 2018


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

Author: Francois Gouget <fgouget at codeweavers.com>
Date:   Thu Jun 14 10:38:35 2018 +0200

testbot/web: Only create a build step if there are VMs that need it.

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

---

 testbot/web/Submit.pl | 65 ++++++++++++++++++++++++++-------------------------
 1 file changed, 33 insertions(+), 32 deletions(-)

diff --git a/testbot/web/Submit.pl b/testbot/web/Submit.pl
index 1425301..c16b99f 100644
--- a/testbot/web/Submit.pl
+++ b/testbot/web/Submit.pl
@@ -2,6 +2,7 @@
 # WineTestBot job submit page
 #
 # Copyright 2009 Ge van Geldorp
+# Copyright 2012-2014, 2017-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
@@ -765,44 +766,16 @@ sub OnSubmit($)
   }
   my $Steps = $NewJob->Steps;
 
-  my $BuildStep;
-  my $FileType = $self->GetParam("FileType");
-  if ($FileType eq "patchdlls")
-  {
-    # This is a patch so add a build step...
-    $BuildStep = $Steps->Add();
-    $BuildStep->FileName($BaseName);
-    $BuildStep->FileType($FileType);
-    $BuildStep->InStaging(!1);
-    $BuildStep->Type("build");
-    $BuildStep->DebugLevel(0);
-
-    # ...with a build task
-    my $VMs = CreateVMs();
-    $VMs->AddFilter("Type", ["build"]);
-    $VMs->AddFilter("Role", ["base"]);
-    my $BuildVM = ${$VMs->GetItems()}[0];
-    my $Task = $BuildStep->Tasks->Add();
-    $Task->VM($BuildVM);
-    $Task->Timeout($BuildTimeout);
-
-    # Save the build step so the others can reference it
-    my ($ErrKey, $ErrProperty, $ErrMessage) = $Jobs->Save();
-    if (defined($ErrMessage))
-    {
-      $self->{ErrMessage} = $ErrMessage;
-      return !1;
-    }
-  }
-
   # Add steps and tasks for the 32 and 64-bit tests
+  my $FileType = $self->GetParam("FileType");
+  my $BuildStep;
   foreach my $Bits ("32", "64")
   {
     next if ($Bits eq "32" && $FileType eq "exe64");
     next if ($Bits eq "64" && $FileType eq "exe32");
     next if ($Bits eq "64" && $FileType eq "patchdlls" && !defined($self->GetParam("Run64")));
-    my $Tasks;
 
+    my $Tasks;
     my $VMs = CreateVMs();
     $VMs->AddFilter("Type", $Bits eq "32" ? ["win32", "win64"] : ["win64"]);
     my $SortedKeys = $VMs->SortKeysBySortOrder($VMs->GetKeys());
@@ -814,7 +787,35 @@ sub OnSubmit($)
 
       if (!$Tasks)
       {
-        # First create the test step
+        if (!$BuildStep and $FileType eq "patchdlls")
+        {
+          # This is a patch so add a build step...
+          $BuildStep = $Steps->Add();
+          $BuildStep->FileName($BaseName);
+          $BuildStep->FileType($FileType);
+          $BuildStep->InStaging(!1);
+          $BuildStep->Type("build");
+          $BuildStep->DebugLevel(0);
+
+          # ...with a build task
+          my $VMs = CreateVMs();
+          $VMs->AddFilter("Type", ["build"]);
+          $VMs->AddFilter("Role", ["base"]);
+          my $BuildVM = ${$VMs->GetItems()}[0];
+          my $Task = $BuildStep->Tasks->Add();
+          $Task->VM($BuildVM);
+          $Task->Timeout($BuildTimeout);
+
+          # Save the build step so the others can reference it
+          my ($ErrKey, $ErrProperty, $ErrMessage) = $Jobs->Save();
+          if (defined($ErrMessage))
+          {
+            $self->{ErrMessage} = $ErrMessage;
+            return !1;
+          }
+        }
+
+        # Then create the test step
         my $TestStep = $Steps->Add();
         if ($FileType eq "patchdlls")
         {




More information about the wine-cvs mailing list