[PATCH] 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(a)codeweavers.com> --- 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 a13b3468e..6951b98c5 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 8afe79396..71e04471d 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 -- 2.17.1
participants (1)
-
Francois Gouget