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@codeweavers.com --- 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 29f7860cb..0f80193f6 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.