Module: tools
Branch: master
Commit: d70d002ded822c29a63a8f97ec62aa9fd43199cd
URL: https://source.winehq.org/git/tools.git/?a=commit;h=d70d002ded822c29a63a8f9…
Author: Francois Gouget <fgouget(a)codeweavers.com>
Date: Tue Sep 25 16:58:15 2018 +0200
testbot: Better check for the "No build or test VM" disposition.
Use a direct test instead of an indirect one.
Also the $Impacts->{UnitCount} field has been renamed.
Signed-off-by: Francois Gouget <fgouget(a)codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard(a)winehq.org>
---
testbot/lib/WineTestBot/Patches.pm | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/testbot/lib/WineTestBot/Patches.pm b/testbot/lib/WineTestBot/Patches.pm
index 469fedc..96e4a0d 100644
--- a/testbot/lib/WineTestBot/Patches.pm
+++ b/testbot/lib/WineTestBot/Patches.pm
@@ -266,7 +266,7 @@ sub Submit($$$)
if ($NewJob->Steps->IsEmpty())
{
# This may be a Wine patch but there is no suitable VM to test it!
- if ($Impacts->{UnitCount})
+ if ($BuildVMs->IsEmpty() and $WineVMs->IsEmpty())
{
$self->Disposition("No build or test VM!");
}
Module: tools
Branch: master
Commit: fc9d4d6ccf7e33bf93c41ce122327925a3f773d2
URL: https://source.winehq.org/git/tools.git/?a=commit;h=fc9d4d6ccf7e33bf93c41ce…
Author: Francois Gouget <fgouget(a)codeweavers.com>
Date: Tue Sep 25 16:57:55 2018 +0200
testbot: Retry updating the wine / build VMs after a timeout.
In case of a regular build failure, retrying is pointless. But in case
of a timeout the VM host may be less busy next time and since the
snapshot is unchanged we can retry.
Signed-off-by: Francois Gouget <fgouget(a)codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard(a)winehq.org>
---
testbot/bin/WineRunReconfig.pl | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/testbot/bin/WineRunReconfig.pl b/testbot/bin/WineRunReconfig.pl
index a58cc42..02eee8c 100755
--- a/testbot/bin/WineRunReconfig.pl
+++ b/testbot/bin/WineRunReconfig.pl
@@ -481,4 +481,7 @@ if ($NewStatus eq 'completed')
# Wrap up
#
-WrapUpAndExit($NewStatus, undef, $TaskTimedOut);
+# In case of a regular build failure retrying is pointless. But in case of a
+# timeout the VM host may be less busy next time and since the snapshot is
+# unchanged we can retry.
+WrapUpAndExit($NewStatus, $TaskTimedOut, $TaskTimedOut);
Module: tools
Branch: master
Commit: cb8a8fabe2c14add78ff9391b9461175e68fda7c
URL: https://source.winehq.org/git/tools.git/?a=commit;h=cb8a8fabe2c14add78ff939…
Author: Francois Gouget <fgouget(a)codeweavers.com>
Date: Tue Sep 25 12:07:30 2018 +0200
testbot: Let VM scripts identify the last part of a patchset.
For patchsets (and subsets thereof) the Engine calls GetPatchImpacts()
at least once with only the last part. This allows it to know exactly
what the last part modifies and thus what needs to be retested.
However the VM scripts only have the full patchset so they don't know
what the last part is. Thus they are forced to rerun every test touched
by the full patchset.
So the TestBot now adds a marker before the last part, allowing
GetPatchImpacts() to identify it. Note that it does not use '---' as
that marker may or may not be present depending on how the patch was
formatted for emailing (and can be ambiguous too).
Signed-off-by: Francois Gouget <fgouget(a)codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard(a)winehq.org>
---
testbot/lib/WineTestBot/PatchUtils.pm | 76 ++++++++++++++++++++---------
testbot/lib/WineTestBot/Patches.pm | 5 +-
testbot/lib/WineTestBot/PendingPatchSets.pm | 5 ++
3 files changed, 60 insertions(+), 26 deletions(-)
diff --git a/testbot/lib/WineTestBot/PatchUtils.pm b/testbot/lib/WineTestBot/PatchUtils.pm
index b7307e5..f03cc40 100644
--- a/testbot/lib/WineTestBot/PatchUtils.pm
+++ b/testbot/lib/WineTestBot/PatchUtils.pm
@@ -31,7 +31,8 @@ the Wine builds.
=cut
use Exporter 'import';
-our @EXPORT = qw(GetPatchImpacts UpdateWineData GetBuildTimeout);
+our @EXPORT = qw(GetPatchImpacts LastPartSeparator UpdateWineData
+ GetBuildTimeout);
use List::Util qw(min max);
@@ -150,6 +151,11 @@ my $IgnoredPathsRe = join('|',
'tools/winemaker/',
);
+sub LastPartSeparator()
+{
+ return "===== TestBot: Last patchset part =====\n";
+}
+
sub _CreateTestInfo($$$)
{
my ($Impacts, $Root, $Dir) = @_;
@@ -261,9 +267,9 @@ configure, whether it impacts the tests, etc.
=back
=cut
-sub GetPatchImpacts($;$)
+sub GetPatchImpacts($)
{
- my ($PatchFileName, $PastImpacts) = @_;
+ my ($PatchFileName) = @_;
my $fh;
return undef if (!open($fh, "<", $PatchFileName));
@@ -281,25 +287,7 @@ sub GetPatchImpacts($;$)
};
_LoadWineFiles();
- if ($PastImpacts)
- {
- # Update the list of Wine files so we correctly recognize patchset parts
- # that modify new Wine files.
- my $WineFiles = $PastImpacts->{WineFiles} || $_WineFiles;
- map { $Impacts->{WineFiles}->{$_} = 1 } keys %{$WineFiles};
- map { $Impacts->{WineFiles}->{$_} = 1 } keys %{$PastImpacts->{NewFiles}};
- map { delete $Impacts->{WineFiles}->{$_} } keys %{$PastImpacts->{DeletedFiles}};
-
- foreach my $PastInfo (values %{$PastImpacts->{Tests}})
- {
- foreach my $File (keys %{$PastInfo->{Files}})
- {
- _HandleFile($Impacts, "$PastInfo->{Path}/$File",
- $PastInfo->{Files}->{$File} eq "rm" ? "rm" : 0);
- }
- }
- }
-
+ my $PastImpacts;
my ($Path, $Change);
while (my $Line = <$fh>)
{
@@ -332,6 +320,50 @@ sub GetPatchImpacts($;$)
$Path = undef;
$Change = "";
}
+ elsif ($Line eq LastPartSeparator())
+ {
+ # All the diffs so far belongs to previous parts of this patchset.
+ # But:
+ # - Only the last part must be taken into account to determine if a
+ # rebuild and testing is needed.
+ # - Yet if a rebuild is needed the previous parts' patches will impact
+ # the scope of the rebuild so that information must be preserved.
+ # So save current impacts in $PastImpacts and reset the current state.
+ $PastImpacts = {};
+
+ # Build a copy of the Wine files list reflecting the current situation.
+ $Impacts->{WineFiles} = { %$_WineFiles } if (!$Impacts->{WineFiles});
+ map { $Impacts->{WineFiles}->{$_} = 1 } keys %{$Impacts->{NewFiles}};
+ map { delete $Impacts->{WineFiles}->{$_} } keys %{$Impacts->{DeletedFiles}};
+ $Impacts->{NewFiles} = {};
+ $Impacts->{DeletedFiles} = {};
+
+ # The modules impacted by previous parts will still need to be built,
+ # but only if the last part justifies a build. So make a backup.
+ $PastImpacts->{BuildModules} = $Impacts->{BuildModules};
+ $Impacts->{BuildModules} = {};
+
+ # Also backup the build-related fields.
+ foreach my $Field ("Autoconf", "MakeMakefiles",
+ "PatchedRoot", "PatchedModules", "PatchedTests")
+ {
+ $PastImpacts->{$Field} = $Impacts->{$Field};
+ $Impacts->{$Field} = undef;
+ }
+
+ # Reset the status of all test unit files to not modified.
+ foreach my $TestInfo (values %{$Impacts->{Tests}})
+ {
+ foreach my $File (keys %{$TestInfo->{Files}})
+ {
+ if ($TestInfo->{Files}->{$File} ne "rm")
+ {
+ $TestInfo->{Files}->{$File} = 0;
+ }
+ }
+ }
+ $Impacts->{ModuleUnitCount} = $Impacts->{TestUnitCount} = 0;
+ }
else
{
$Path = undef;
diff --git a/testbot/lib/WineTestBot/Patches.pm b/testbot/lib/WineTestBot/Patches.pm
index 0387543..469fedc 100644
--- a/testbot/lib/WineTestBot/Patches.pm
+++ b/testbot/lib/WineTestBot/Patches.pm
@@ -132,10 +132,7 @@ sub Submit($$$)
{
my ($self, $PatchFileName, $IsSet) = @_;
- my $PastImpacts;
- $PastImpacts = GetPatchImpacts($PatchFileName) if ($IsSet);
- my $Impacts = GetPatchImpacts("$DataDir/patches/" . $self->Id, $PastImpacts);
-
+ my $Impacts = GetPatchImpacts($PatchFileName);
if (!$Impacts->{PatchedRoot} and !$Impacts->{PatchedModules} and
!$Impacts->{PatchedTests})
{
diff --git a/testbot/lib/WineTestBot/PendingPatchSets.pm b/testbot/lib/WineTestBot/PendingPatchSets.pm
index 3ac8c53..286b393 100644
--- a/testbot/lib/WineTestBot/PendingPatchSets.pm
+++ b/testbot/lib/WineTestBot/PendingPatchSets.pm
@@ -42,6 +42,7 @@ use WineTestBot::WineTestBotObjects;
our @ISA = qw(WineTestBot::WineTestBotItem);
use WineTestBot::Config;
+use WineTestBot::PatchUtils;
use WineTestBot::Utils;
@@ -116,6 +117,10 @@ sub SubmitSubset($$$)
last;
}
+ if ($PartNo == $MaxPart and $PartNo > 1)
+ {
+ print $CombinedFile LastPartSeparator();
+ }
if (open(my $PartFile, "<" , "$DataDir/patches/" . $Part->Patch->Id))
{
print $CombinedFile $_ for (<$PartFile>);