Module: tools
Branch: master
Commit: 954f6a7bfa64851fb43349b268095569e3eda2df
URL: https://source.winehq.org/git/tools.git/?a=commit;h=954f6a7bfa64851fb43349b…
Author: Francois Gouget <fgouget(a)codeweavers.com>
Date: Tue Oct 30 03:42:20 2018 +0100
testbot: Build the list of test units impacted by module patches.
A patch to a dll or program is likely to impact its test units. This
makes it possible to know which tests units to rerun.
Signed-off-by: Francois Gouget <fgouget(a)codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard(a)winehq.org>
---
testbot/lib/WineTestBot/PatchUtils.pm | 16 ++++++++++------
1 file changed, 10 insertions(+), 6 deletions(-)
diff --git a/testbot/lib/WineTestBot/PatchUtils.pm b/testbot/lib/WineTestBot/PatchUtils.pm
index 444ffaf..fb4f886 100644
--- a/testbot/lib/WineTestBot/PatchUtils.pm
+++ b/testbot/lib/WineTestBot/PatchUtils.pm
@@ -216,6 +216,7 @@ sub _HandleFile($$$)
my $Module = _CreateTestInfo($Impacts, $Root, $Dir);
$Impacts->{PatchedModules} = 1;
+ $Impacts->{Tests}->{$Module}->{PatchedModule} = 1;
if ($File eq "Makefile.in" and $Change ne "modify")
{
@@ -407,20 +408,23 @@ sub GetPatchImpacts($)
$TestInfo->{Units} = {};
foreach my $File (keys %{$TestInfo->{Files}})
{
- # Skip unmodified files
- next if (!$TestInfo->{All} and !$TestInfo->{Files}->{$File});
-
my $Base = $File;
# Non-C files are not test units
next if ($Base !~ s/(?:\.c|\.spec)$//);
# Helper dlls are not test units
next if (exists $TestInfo->{Files}->{"$Base.spec"});
+ # Don't try running a deleted test unit obviously
+ next if ($TestInfo->{Files}->{$File} eq "rm");
- if (($TestInfo->{All} or $TestInfo->{Files}->{$File}) and
- $TestInfo->{Files}->{$File} ne "rm")
+ if ($TestInfo->{All} or $TestInfo->{Files}->{$File})
{
- # Only new/modified test units are impacted
$TestInfo->{Units}->{$Base} = 1;
+ $Impacts->{ModuleUnitCount}++;
+ }
+ elsif ($TestInfo->{PatchedModule})
+ {
+ # The module has been patched so this test unit is impacted indirectly.
+ $Impacts->{ModuleUnitCount}++;
}
}
Module: tools
Branch: master
Commit: c4f54ba61543016f0922a22170538e4b3e0f66c8
URL: https://source.winehq.org/git/tools.git/?a=commit;h=c4f54ba61543016f0922a22…
Author: Francois Gouget <fgouget(a)codeweavers.com>
Date: Tue Oct 30 03:42:02 2018 +0100
testbot/WineRunWineTest: Remove support for the build Step type.
Signed-off-by: Francois Gouget <fgouget(a)codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard(a)winehq.org>
---
testbot/bin/WineRunWineTest.pl | 75 ++++++++++++++++++++----------------------
1 file changed, 36 insertions(+), 39 deletions(-)
diff --git a/testbot/bin/WineRunWineTest.pl b/testbot/bin/WineRunWineTest.pl
index 5b6eb33..3784ef0 100755
--- a/testbot/bin/WineRunWineTest.pl
+++ b/testbot/bin/WineRunWineTest.pl
@@ -383,7 +383,7 @@ if (!$VM->GetDomain()->IsPoweredOn())
FatalError("The VM is not powered on\n");
}
-if ($Step->Type ne "build" and $Step->Type ne "suite" and $Step->Type ne "single")
+if ($Step->Type ne "suite" and $Step->Type ne "single")
{
FatalError("Unexpected step type '". $Step->Type ."' found\n");
}
@@ -497,7 +497,7 @@ if (!defined $TA->Wait($Pid, $Task->Timeout, 60))
}
else
{
- $PossibleCrash = 1 if ($Step->Type ne "build");
+ $PossibleCrash = 1;
$TAError = "An error occurred while waiting for the task to complete: $ErrMessage";
$ErrMessage = undef;
}
@@ -549,49 +549,46 @@ elsif (!defined $TAError)
# Grab the test reports if any
#
-if ($Step->Type ne "build")
+foreach my $Build (keys %{$TaskMissions->{Builds}})
{
- foreach my $Build (keys %{$TaskMissions->{Builds}})
+ my $RptFileName = "$Build.report";
+ Debug(Elapsed($Start), " Retrieving '$RptFileName'\n");
+ if ($TA->GetFile($RptFileName, "$TaskDir/$RptFileName"))
{
- my $RptFileName = "$Build.report";
- Debug(Elapsed($Start), " Retrieving '$RptFileName'\n");
- if ($TA->GetFile($RptFileName, "$TaskDir/$RptFileName"))
- {
- chmod 0664, "$TaskDir/$RptFileName";
+ chmod 0664, "$TaskDir/$RptFileName";
- my ($TestUnitCount, $TimeoutCount, $LogFailures, $LogErrors) = ParseWineTestReport("$TaskDir/$RptFileName", 1, $TaskTimedOut);
- $TaskTimedOut = 1 if ($TestUnitCount == $TimeoutCount);
- if (!defined $LogFailures and @$LogErrors == 1)
- {
- # Could not open the file
- $NewStatus = 'boterror';
- Error "Unable to open '$RptFileName' for reading: $!\n";
- LogTaskError("Unable to open '$RptFileName' for reading: $!\n");
- }
- else
- {
- # $LogFailures can legitimately be undefined in case of a timeout
- $TaskFailures += $LogFailures || 0;
- if (@$LogErrors and open(my $Log, ">", "$TaskDir/$RptFileName.err"))
- {
- # Save the extra errors detected by ParseWineTestReport() in
- # $RptFileName.err:
- # - This keep the .report file clean.
- # - Each .err file can be matched to its corresponding .report, even
- # if there are multiple .report files in the directory.
- # - The .err file can be moved to the latest directory next to the
- # reference report.
- print $Log "$_\n" for (@$LogErrors);
- close($Log);
- }
- }
- }
- elsif (!defined $TAError and
- $TA->GetLastError() !~ /: No such file or directory/)
+ my ($TestUnitCount, $TimeoutCount, $LogFailures, $LogErrors) = ParseWineTestReport("$TaskDir/$RptFileName", 1, $TaskTimedOut);
+ $TaskTimedOut = 1 if ($TestUnitCount == $TimeoutCount);
+ if (!defined $LogFailures and @$LogErrors == 1)
{
- $TAError = "An error occurred while retrieving $RptFileName: ". $TA->GetLastError();
+ # Could not open the file
$NewStatus = 'boterror';
+ Error "Unable to open '$RptFileName' for reading: $!\n";
+ LogTaskError("Unable to open '$RptFileName' for reading: $!\n");
}
+ else
+ {
+ # $LogFailures can legitimately be undefined in case of a timeout
+ $TaskFailures += $LogFailures || 0;
+ if (@$LogErrors and open(my $Log, ">", "$TaskDir/$RptFileName.err"))
+ {
+ # Save the extra errors detected by ParseWineTestReport() in
+ # $RptFileName.err:
+ # - This keep the .report file clean.
+ # - Each .err file can be matched to its corresponding .report, even
+ # if there are multiple .report files in the directory.
+ # - The .err file can be moved to the latest directory next to the
+ # reference report.
+ print $Log "$_\n" for (@$LogErrors);
+ close($Log);
+ }
+ }
+ }
+ elsif (!defined $TAError and
+ $TA->GetLastError() !~ /: No such file or directory/)
+ {
+ $TAError = "An error occurred while retrieving $RptFileName: ". $TA->GetLastError();
+ $NewStatus = 'boterror';
}
}