Module: tools Branch: master Commit: 6521df329b7b38d55f3d84ad7783097ee97ef382 URL: https://source.winehq.org/git/tools.git/?a=commit;h=6521df329b7b38d55f3d84ad...
Author: Francois Gouget fgouget@codeweavers.com Date: Thu May 31 10:06:10 2018 +0200
testbot: Fix handling of test unit additions/removals in patch series.
The TestBot used to only analyse the last patch in the series to determine whether it impacts the tests or not. However patches to resource files and helper dlls require having an up-to-date list of the test units, and that list may be impacted by previous patches in the series.
Signed-off-by: Francois Gouget fgouget@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
testbot/lib/WineTestBot/PatchUtils.pm | 19 +++++++++++++++++-- testbot/lib/WineTestBot/Patches.pm | 4 +++- 2 files changed, 20 insertions(+), 3 deletions(-)
diff --git a/testbot/lib/WineTestBot/PatchUtils.pm b/testbot/lib/WineTestBot/PatchUtils.pm index a466df3..611d883 100644 --- a/testbot/lib/WineTestBot/PatchUtils.pm +++ b/testbot/lib/WineTestBot/PatchUtils.pm @@ -127,9 +127,9 @@ configure, whether it impacts the tests, etc. =back =cut
-sub GetPatchImpact($;$) +sub GetPatchImpact($;$$) { - my ($PatchFileName, $NoUnits) = @_; + my ($PatchFileName, $NoUnits, $PastImpacts) = @_;
my $fh; return undef if (!open($fh, "<", $PatchFileName)); @@ -138,6 +138,21 @@ sub GetPatchImpact($;$) NoUnits => $NoUnits, Tests => {}, }; + + if ($PastImpacts) + { + foreach my $PastInfo (values %{$PastImpacts->{Tests}}) + { + if ($PastInfo->{Files}) + { + foreach my $File (keys %{$PastInfo->{Files}}) + { + _AddTest($Impacts, "$PastInfo->{Path}/$File", + $PastInfo->{Files}->{$File} eq "rm" ? "rm" : 0); + } + } + } + } my ($Path, $Change); while (my $Line = <$fh>) { diff --git a/testbot/lib/WineTestBot/Patches.pm b/testbot/lib/WineTestBot/Patches.pm index d4a5e0b..71d735b 100644 --- a/testbot/lib/WineTestBot/Patches.pm +++ b/testbot/lib/WineTestBot/Patches.pm @@ -132,7 +132,9 @@ sub Submit($$$) { my ($self, $PatchFileName, $IsSet) = @_;
- my $Impacts = GetPatchImpact("$DataDir/patches/" . $self->Id); + my $PastImpacts; + $PastImpacts = GetPatchImpact($PatchFileName) if ($IsSet); + my $Impacts = GetPatchImpact("$DataDir/patches/" . $self->Id, undef, $PastImpacts); if (!$Impacts->{UnitCount}) { $self->Disposition(($IsSet ? "Set" : "Patch") .