Francois Gouget : testbot: Fix UpdateStatus() to handle empty jobs and steps.

Alexandre Julliard julliard at winehq.org
Wed Jun 13 14:00:26 CDT 2018


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

Author: Francois Gouget <fgouget at codeweavers.com>
Date:   Wed Jun 13 11:47:05 2018 +0200

testbot: Fix UpdateStatus() to handle empty jobs and steps.

We should not have empty jobs and steps but if we do make sure they are
marked 'completed'.

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

---

 testbot/lib/WineTestBot/Jobs.pm  | 1 +
 testbot/lib/WineTestBot/Steps.pm | 1 +
 2 files changed, 2 insertions(+)

diff --git a/testbot/lib/WineTestBot/Jobs.pm b/testbot/lib/WineTestBot/Jobs.pm
index a13b346..6951b98 100644
--- a/testbot/lib/WineTestBot/Jobs.pm
+++ b/testbot/lib/WineTestBot/Jobs.pm
@@ -229,6 +229,7 @@ sub UpdateStatus($)
     my $StepStatus = $Step->UpdateStatus($Skip);
     $Has{$StepStatus} = 1;
   }
+  $Has{completed} = 1 if (!%Has); # This job has no step!
 
   # Inherit the steps most significant status.
   # Note that one or more tasks may have been requeued during the cleanup phase
diff --git a/testbot/lib/WineTestBot/Steps.pm b/testbot/lib/WineTestBot/Steps.pm
index 8afe793..71e0447 100644
--- a/testbot/lib/WineTestBot/Steps.pm
+++ b/testbot/lib/WineTestBot/Steps.pm
@@ -200,6 +200,7 @@ sub UpdateStatus($$)
 
   my %Has;
   map { $Has{$_->UpdateStatus($Skip)} = 1 } (@{$self->Tasks->Clone()->GetItems()});
+  $Has{completed} = 1 if (!%Has); # This step has no task!
 
   # Inherit the tasks most significant status.
   # Note that one or more tasks may have been requeued during the cleanup phase




More information about the wine-cvs mailing list