Module: tools Branch: master Commit: 135c6f146466e56c4ed7821f91e380664598ee97 URL: https://gitlab.winehq.org/winehq/tools/-/commit/135c6f146466e56c4ed7821f91e3...
Author: Francois Gouget fgouget@codeweavers.com Date: Wed Nov 2 16:53:58 2022 +0100
testbot/TestWTBS: Issue an error if $OnlyCompletePatchSets is set.
The test suite needs to be able to check the handling of all parts of a patchset and is thus incompatible with this setting. The error is only issued once and the impacted jobs are skipped to avoid duplicate errors.
---
testbot/tests/TestWTBS | 57 ++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 55 insertions(+), 2 deletions(-)
diff --git a/testbot/tests/TestWTBS b/testbot/tests/TestWTBS index f7d4fcfb..33074a82 100755 --- a/testbot/tests/TestWTBS +++ b/testbot/tests/TestWTBS @@ -259,11 +259,12 @@ sub SkipCheck($) return (defined $Value and $Value eq "ignore"); }
-sub LoadTestInfo($) +sub LoadRawTestInfo($) { my ($FileName) = @_;
my $RawInfo; + my $SectionCount = 0; if (open(my $TestFh, "<", $FileName)) { parser: while (my $Line = <$TestFh>) @@ -275,6 +276,7 @@ sub LoadTestInfo($) { # Patch series may have multiple TestWTBS sections, one per part. # Only the last one counts. + $SectionCount++; $RawInfo = { LogName => basename($FileName), LogPath => $FileName, @@ -297,6 +299,10 @@ sub LoadTestInfo($) delete $RawInfo->{BadLog}; } } + elsif ($Line eq "===== TestBot: Last patchset part =====") + { + $SectionCount = 0; + } } close($TestFh);
@@ -312,6 +318,35 @@ sub LoadTestInfo($) return undef; }
+ $RawInfo->{SectionCount} = $SectionCount; + return $RawInfo; +} + +my $BrokenPatchSets; + +sub WarnBrokenPatchSets() +{ + if (!$BrokenPatchSets) + { + # The WTBS needs to be able to check how the TestBot handles patchset + # parts. + fail("$OnlyCompletePatchSets=1 is incompatible with the WTBS\n"); + $BrokenPatchSets = 1; + } +} + +sub LoadTestInfo($) +{ + my ($FileName) = @_; + + my $RawInfo = LoadRawTestInfo($FileName); + return undef if (!$RawInfo); + if ($RawInfo->{SectionCount} > 1) + { + WarnBrokenPatchSets(); + return undef; + } + # Split up the information to jobs, tasks, etc. my $TestInfo = { webpatch => {}, patch => {}, job => {}, @@ -329,6 +364,10 @@ sub LoadTestInfo($) $TestInfo->{$TaskType}->{$Field} = $RawInfo->{$Entry}; $HasTestInfo = 1; } + elsif ($Entry eq "SectionCount") + { + # Ignore these + } elsif ($Entry !~ /^(?:CurGroup|eCount|eNew|MsgGroups|MsgGroupNames|LineNo|LogName|LogPath)$/) { fail("$FileName: $Entry is not a valid property name"); @@ -1181,6 +1220,16 @@ sub CheckJobTree($;$) $TestInfo = LoadTestInfo($Step->GetFullFileName()); return if (!$TestInfo); } + elsif ($Step->FileType eq "patch") + { + my $RawInfo = LoadRawTestInfo($Step->GetFullFileName()); + if ($RawInfo->{SectionCount} > 1) + { + WarnBrokenPatchSets(); + print "...skipping job ". $Job->Id ." because $OnlyCompletePatchSets is set\n"; + return; + } + }
my $TaskType = $Step->Type eq "build" ? "build" : $Step->FileType eq "patch" ? "wine" : @@ -1412,7 +1461,11 @@ sub CheckPatch($$$) }
my $PatchInfo = $TestInfo->{patch}; - if (CheckValue($PatchInfo->{Disposition})) + if ($Patch->Disposition =~ /^(?:Only test full series|Series is not a Wine patch)/) + { + WarnBrokenPatchSets(); + } + elsif (CheckValue($PatchInfo->{Disposition})) { is($Patch->Disposition, $PatchInfo->{Disposition}, "Check Disposition for patch ". $Patch->Id .": ". $Patch->Subject); }