Module: tools Branch: master Commit: 8327729fa149fbf23678a29fe85a1ecf9321d49a URL: https://gitlab.winehq.org/winehq/tools/-/commit/8327729fa149fbf23678a29fe85a...
Author: Francois Gouget fgouget@codeweavers.com Date: Tue Aug 1 12:30:40 2023 +0200
testbot/web: Add support for filtering the failures list.
In particular this can be used to look up the bug corresponding to a failure line if any.
---
testbot/web/FailuresList.pl | 76 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+)
diff --git a/testbot/web/FailuresList.pl b/testbot/web/FailuresList.pl index d1f8de6d..505b7e3a 100644 --- a/testbot/web/FailuresList.pl +++ b/testbot/web/FailuresList.pl @@ -50,6 +50,37 @@ sub Create($$) return FailuresBlock->new($Collection, $EnclosingPage); }
+sub GenerateFormStart() +{ + my ($self) = @_; + $self->SUPER::GenerateFormStart(); + + my $Config = $self->escapeHTML($self->{EnclosingPage}->GetParam("Config") || ""); + my $Module = $self->escapeHTML($self->{EnclosingPage}->GetParam("Module") || ""); + my $Line = $self->escapeHTML($self->{EnclosingPage}->GetParam("Line") || ""); + print <<EOF; + <div class='ItemProperty'><label><a class='title' title="Optionally add the architecture after a ':'">Test configuration</a></label> + <div class='ItemValue'> + <input type='text' name='Config' placeholder='VM name' maxlength='20' size='20' value='$Config' /> + </div> + </div> + <div class='ItemProperty'><label><a class='title' title='or "Report validation errors"'>Module</a></label> + <div class='ItemValue'> + <input type='text' name='Module' placeholder='Dll or program name' maxlength='64' size='64' value='$Module' /> + </div> + </div> + <div class='ItemProperty'><label>Failure line</label> + <div class='ItemValue'> + <input type='text' name='Line' placeholder='Failure, unhandled exception, validation error, ...' maxlength='512' size='64' value='$Line' /> + </div> + </div> + <div class='ItemActions'> + <input type='submit' value='Filter'/> + </div> +<p></p> +EOF +} + sub DisplayProperty($$) { my ($self, $PropertyDescriptor) = @_; @@ -114,6 +145,51 @@ sub GenerateDataView($$$) } }
+sub GetSortedItems($) +{ + my ($self) = @_; + my $Items = $self->{Collection}->GetSortedItems(); + + my $Config = $self->{EnclosingPage}->GetParam("Config"); + my $Module = $self->{EnclosingPage}->GetParam("Module"); + my $Line = $self->{EnclosingPage}->GetParam("Line"); + if ($Config or $Module or $Line) + { + my $TestUnit; + $TestUnit = $1 if ($Line and $Line =~ /^([_a-z0-9]+).c:\d+:/); + + my @Failures; + foreach my $Failure (@$Items) + { + next if ($Module and $Module ne $Failure->ErrorGroup); + next if ($TestUnit and $TestUnit ne $Failure->TestUnit); + + if ($Config) + { + my $RegExp = $Failure->ConfigRegExp; + my $Match = eval { + use warnings FATAL => qw(regexp); + !$RegExp or $Config =~ /$RegExp/; + }; + next if (!$Match); + } + if ($Line) + { + my $RegExp = $Failure->FailureRegExp; + my $Match = eval { + use warnings FATAL => qw(regexp); + !$RegExp or $Line =~ /$RegExp/; + }; + next if (!$Match); + } + + push @Failures, $Failure; + } + $Items = @Failures; + } + return $Items; +} + sub GetItemActions($) { my ($self) = @_;