Francois Gouget : testbot: Take Step dependencies into account in Job:: UpdateStatus().

Alexandre Julliard julliard at winehq.org
Wed Apr 25 13:54:04 CDT 2018


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

Author: Francois Gouget <fgouget at codeweavers.com>
Date:   Wed Apr 25 14:00:31 2018 +0200

testbot: Take Step dependencies into account in Job::UpdateStatus().

Job::UpdateStatus() used to assume that Step n would always depend on
Step n-1. But now Step n may depend on Step 1 or any other previous
step instead.

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

---

 testbot/lib/WineTestBot/Jobs.pm | 27 ++++++++++++++++-----------
 1 file changed, 16 insertions(+), 11 deletions(-)

diff --git a/testbot/lib/WineTestBot/Jobs.pm b/testbot/lib/WineTestBot/Jobs.pm
index 29f7860..0f80193 100644
--- a/testbot/lib/WineTestBot/Jobs.pm
+++ b/testbot/lib/WineTestBot/Jobs.pm
@@ -179,21 +179,26 @@ sub UpdateStatus($)
   my $Status = $self->Status;
   return $Status if ($Status ne "queued" && $Status ne "running");
 
-  my (%Has, $Skip);
-  my @SortedSteps = sort { $a->No <=> $b->No } @{$self->Steps->GetItems()};
+  my %Has;
+  my $Steps = $self->Steps;
+  my @SortedSteps = sort { $a->No <=> $b->No } @{$Steps->GetItems()};
   foreach my $Step (@SortedSteps)
   {
-    my $StepStatus = $Step->UpdateStatus($Skip);
-    $Has{$StepStatus} = 1;
-
-    if ($StepStatus ne "queued" && $StepStatus ne "running" &&
-        $StepStatus ne "completed" &&
-        ($Step->Type eq "build" || $Step->Type eq "reconfig"))
+    my $Skip;
+    if ($Step->PreviousNo)
     {
-      # The following steps need binaries that this one was supposed to
-      # produce. So skip them.
-      $Skip = 1;
+      my $PrevStatus = $Steps->GetItem($Step->PreviousNo)->Status;
+      if ($PrevStatus ne "queued" && $PrevStatus ne "running" &&
+          $PrevStatus ne "completed")
+      {
+        # The previous step was supposed to provide binaries but it failed
+        # or was canceled. So skip this one.
+        $Skip = 1;
+      }
     }
+
+    my $StepStatus = $Step->UpdateStatus($Skip);
+    $Has{$StepStatus} = 1;
   }
 
   # Inherit the steps most significant status.




More information about the wine-cvs mailing list