Module: tools
Branch: master
Commit: 4fa680f6cb1764d5d62621df8685c6b95ae6e206
URL: https://source.winehq.org/git/tools.git/?a=commit;h=4fa680f6cb1764d5d62621d…
Author: Francois Gouget <fgouget(a)codeweavers.com>
Date: Mon Mar 1 16:27:21 2021 +0100
testbot/TestWTBS: Adjust the TestUnits check to the wine test/module missions.
Don't complain that the test=test or test=module case is missing test
units if there was no mission of that type.
Signed-off-by: Francois Gouget <fgouget(a)codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard(a)winehq.org>
---
testbot/tests/TestWTBS | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/testbot/tests/TestWTBS b/testbot/tests/TestWTBS
index 915eab6..e9fa98e 100755
--- a/testbot/tests/TestWTBS
+++ b/testbot/tests/TestWTBS
@@ -894,6 +894,7 @@ sub CheckTask($$$$)
$MissionType .= ":$Test";
}
$ReportTypes{$ReportName} = $MissionType;
+ $TestUnits->{$MissionType} ||= {};
}
}
my $TestType = ($TaskType eq "wine" and !$IsTestTask) ?
@@ -1203,6 +1204,9 @@ sub CheckJobTree($;$)
my @MissionTypes = $Type eq "wine" ? ("wine:test", "wine:module") : ($Type);
foreach my $MissionType (@MissionTypes)
{
+ # Skip if there was no task running this type of mission
+ next if (!$TestUnits->{$MissionType});
+
my $MissionInfo = $TestInfo->{$MissionType};
next if (!CheckValue($MissionInfo->{TestUnits}));
Module: tools
Branch: master
Commit: fb7976fe8ff747a4c5239c14762f9e6601054a6c
URL: https://source.winehq.org/git/tools.git/?a=commit;h=fb7976fe8ff747a4c5239c1…
Author: Francois Gouget <fgouget(a)codeweavers.com>
Date: Mon Mar 1 16:27:31 2021 +0100
testbot/TestWTBS: Fix the TestFailures checks for pure wine:build tasks.
Such tasks will obviously not have any failure from the test units so
take that into account.
Signed-off-by: Francois Gouget <fgouget(a)codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard(a)winehq.org>
---
testbot/tests/TestWTBS | 74 ++++++++++++++++++++++++++++++++------------------
1 file changed, 48 insertions(+), 26 deletions(-)
diff --git a/testbot/tests/TestWTBS b/testbot/tests/TestWTBS
index 9a590cb..915eab6 100755
--- a/testbot/tests/TestWTBS
+++ b/testbot/tests/TestWTBS
@@ -871,18 +871,6 @@ sub CheckTask($$$$)
{
my ($Task, $TaskType, $TestInfo, $TestUnits) = @_;
- my $TaskInfo = $TestInfo->{$TaskType};
- if (CheckValue($TaskInfo->{Status}))
- {
- is($Task->Status, $TaskInfo->{Status}, "Check Status of task ". TaskKeyStr($Task));
- }
- if ($Task->Status =~ /^bad/)
- {
- # It makes no sense to check which test units were run in case of a build
- # error.
- $TestUnits->{$TaskType}->{"*skipped*"} = 1;
- }
-
# Assume the VM's Missions field has not changed since the tests were run
my ($ErrMessage, $Missions) = ParseMissionStatement($Task->Missions);
if (@$Missions != 1)
@@ -891,22 +879,42 @@ sub CheckTask($$$$)
return;
}
- my %ReportTypes;
+ my (%ReportTypes, $IsTestTask);
if ($TaskType =~ /^win/)
{
+ $IsTestTask = 1 if ($TaskType =~ /^win(?:32|64)$/);
foreach my $Mission (@{$Missions->[0]->{Missions}})
{
my $ReportName = GetMissionBaseName($Mission) .".report";
my $MissionType = $TaskType;
- $MissionType .= ":". ($Mission->{test} || "test") if ($TaskType eq "wine");
+ if ($TaskType eq "wine")
+ {
+ my $Test = $Mission->{test} || "test";
+ $IsTestTask = 1 if ($Test =~ /^(?:test|module)/);
+ $MissionType .= ":$Test";
+ }
$ReportTypes{$ReportName} = $MissionType;
}
}
+ my $TestType = ($TaskType eq "wine" and !$IsTestTask) ?
+ "wine:build" : $TaskType;
+ my $TaskInfo = $TestInfo->{$TestType};
+
+ if (CheckValue($TaskInfo->{Status}))
+ {
+ is($Task->Status, $TaskInfo->{Status}, "Check Status of task ". TaskKeyStr($Task));
+ }
+ if ($Task->Status =~ /^bad/)
+ {
+ # It makes no sense to check which test units were run in case of a build
+ # error.
+ $TestUnits->{$TaskType}->{"*skipped*"} = 1;
+ }
my $CheckTimeouts = ($Task->Status eq "completed" and
CheckValue($TaskInfo->{HasTimeout}));
- my $ExpectedFailures;
+ my ($ReportFailures, $IgnoreFailures);
my ($ReportCount, $TimeoutCount, $NewFailures) = (0, 0, 0);
foreach my $LogName (@{GetLogFileNames($Task->GetDir())})
{
@@ -915,7 +923,7 @@ sub CheckTask($$$$)
$NewFailures += $LogInfo->{NewCount} || 0;
# Get the mission-specific "wine:xxx" report directives
- my $MissionType = $ReportTypes{$LogName} || $TaskType;
+ my $MissionType = $ReportTypes{$LogName} || $TestType;
my $MissionInfo = $TestInfo->{$MissionType};
my $LogType = "log";
if ($LogName =~ /\.report$/)
@@ -936,11 +944,11 @@ sub CheckTask($$$$)
ok(($LogInfo->{ErrCount} || 0) <= $MissionInfo->{TestFailures},
"Check Failures of $LogName in task ". TaskKeyStr($Task))
or diag("report error count = ", ($LogInfo->{ErrCount} || 0), ", expected at most $MissionInfo->{TestFailures}");
- $ExpectedFailures += $MissionInfo->{TestFailures};
+ $ReportFailures += $MissionInfo->{TestFailures};
}
else
{
- $ExpectedFailures = undef;
+ $IgnoreFailures = 1;
}
}
elsif ($LogName =~ /^testbot\./)
@@ -963,20 +971,34 @@ sub CheckTask($$$$)
}
if ($Task->Status eq "completed")
{
- if (defined $ExpectedFailures)
+ if ($IsTestTask and ($ReportCount or CheckValue($TaskInfo->{TestUnits})))
+ {
+ if ($IgnoreFailures)
+ {
+ # For some mission types (typically test=module) the failure count
+ # is unpredictable and cannot be checked.
+ ; # Nothing to do
+ }
+ elsif ($ReportCount)
+ {
+ # The task's failure count must be compared to the sum of the failure
+ # counts of each test report.
+ is($Task->TestFailures, $ReportFailures, "Check Failures of task ". TaskKeyStr($Task));
+ }
+ elsif (CheckValue($TaskInfo->{TestFailures}))
+ {
+ # There is no report if the VM crashed / rebooted
+ is($Task->TestFailures, $TaskInfo->{TestFailures}, "Check Failures of task ". TaskKeyStr($Task));
+ }
+ }
+ elsif (!$IsTestTask and $ReportCount)
{
- is($Task->TestFailures, $ExpectedFailures, "Check Failures of task ". TaskKeyStr($Task));
+ fail("A $TestType task should not have $ReportCount test reports");
}
elsif (CheckValue($TaskInfo->{TestFailures}) and !$ReportCount)
{
- # Scale the expected TestFailures count with the number of times the test
- # was run, i.e. $ReportCount, or take it as is if no report is available.
is($Task->TestFailures, $TaskInfo->{TestFailures}, "Check Failures of task ". TaskKeyStr($Task));
}
- # else there are reports for which we cannot check the TestFailures count.
- # In particular this can happen if the test failure count can be checked
- # for test=test but not for test=module. Then whether TestFailures can be
- # checked or not depends on the missions mix.
}
return $NewFailures;
}
Module: tools
Branch: master
Commit: 0dcfca843ad0a87d95ff69a39f9ecba6c3cfa006
URL: https://source.winehq.org/git/tools.git/?a=commit;h=0dcfca843ad0a87d95ff69a…
Author: Francois Gouget <fgouget(a)codeweavers.com>
Date: Mon Mar 1 16:26:18 2021 +0100
testbot/TestWTBS: Improve the error checking documentation.
Signed-off-by: Francois Gouget <fgouget(a)codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard(a)winehq.org>
---
testbot/tests/TestWTBS | 19 ++++++++++++++-----
1 file changed, 14 insertions(+), 5 deletions(-)
diff --git a/testbot/tests/TestWTBS b/testbot/tests/TestWTBS
index 5069355..85eb0e8 100755
--- a/testbot/tests/TestWTBS
+++ b/testbot/tests/TestWTBS
@@ -657,14 +657,23 @@ n 0 comm.c:2210: Test failed: WTBS Simulate an unreported test failure
g 0 tests.report.Report validation errors
n 0 kernel32:comm has unaccounted for failure messages
-This checks that the 'comm.c' failure appears in the 'kernel32' group
-of the reports of all test tasks; that the TestBot issues a report consistency
-failure as well; and that no other new error is present. If no preexisting
-errors are expected, that is if test unit produces no failure when run outside
-the test suite, then one could also issue the following check:
+This checks that the 'comm.c' failure appears in the 'kernel32' group of the
+reports of all test tasks; that the TestBot issues a report consistency
+failure as well; that no other new error is present in either group; and that
+there are no other error groups.
+
+If no preexisting errors are expected, that is if the test unit produces no
+failure when run outside the test suite, then one could also issue the
+following check:
p tests.TestFailures 2
+Note that if there is no group directive this test is skipped. So to check that
+there is no error one would declare an empty group such as below, though a
+'TestFailures 0' check seems like a clearer and better approach.
+
+g 0 tests.report.kernel32
+
Finally, note that while the error directives are inherited by subcategories,
they are not merged. So if if both win and win32 have error-matching
directives, win32 will not inherit anything from the win category.
Module: tools
Branch: master
Commit: 13c4f85d07932c56461716f1997b0f9dab87f1e7
URL: https://source.winehq.org/git/tools.git/?a=commit;h=13c4f85d07932c56461716f…
Author: Francois Gouget <fgouget(a)codeweavers.com>
Date: Mon Mar 1 16:24:33 2021 +0100
testbot/TestWTBS: The build tasks should not have test units.
First check that TestUnits was not accidentally set for build and
wine:build tasks, and then set it to an empty string (which is not
possible from via regular directives) which means any test unit will
show up as an error.
Signed-off-by: Francois Gouget <fgouget(a)codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard(a)winehq.org>
---
testbot/tests/TestWTBS | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/testbot/tests/TestWTBS b/testbot/tests/TestWTBS
index 1467c4b..29c11d6 100755
--- a/testbot/tests/TestWTBS
+++ b/testbot/tests/TestWTBS
@@ -361,9 +361,10 @@ sub LoadTestInfo($)
SetDefault($TestInfo, "tasks", "Status", "completed");
SetDefault($TestInfo, "tasks", "HasTask", 1);
}
- if (defined $TestInfo->{"wine:build"}->{TestUnits})
+ foreach my $BuildType ("build", "wine:build")
{
- fail("wine:build.TestUnits should not be set");
+ next if (!defined $TestInfo->{$BuildType}->{TestUnits});
+ fail("$BuildType.TestUnits should not be set");
}
# Then propagate the defaults
@@ -396,8 +397,9 @@ sub LoadTestInfo($)
}
}
}
- # Reset the inherited wine:build.TestUnits since it makes no sense
- delete $TestInfo->{"wine:build"}->{TestUnits};
+ # build and wine:build tasks should not be running tests
+ $TestInfo->{"build"}->{TestUnits} = "";
+ $TestInfo->{"wine:build"}->{TestUnits} = "";
# Automatically check the Task: lines in simple cases
foreach my $Build ("build", "wine:build")
Module: tools
Branch: master
Commit: 58f242ec35fcf46074bca43d7ea457886729ae4b
URL: https://source.winehq.org/git/tools.git/?a=commit;h=58f242ec35fcf46074bca43…
Author: Francois Gouget <fgouget(a)codeweavers.com>
Date: Mon Mar 1 16:15:45 2021 +0100
testbot/web: Limit the number of days shown on the index page.
By default only show jobs from the last 4 days to speed up generating
and loading the page. The limit can of course be changed through the
page to access older jobs.
One can also get their own default by adding '?Days=N' at the end of the
bookmarked TestBot URL.
Signed-off-by: Francois Gouget <fgouget(a)codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard(a)winehq.org>
---
testbot/lib/WineTestBot/Config.pm | 5 +++--
testbot/web/index.pl | 45 +++++++++++++++++++++++++++++++++++++--
2 files changed, 46 insertions(+), 4 deletions(-)
diff --git a/testbot/lib/WineTestBot/Config.pm b/testbot/lib/WineTestBot/Config.pm
index 3127972..252c63c 100644
--- a/testbot/lib/WineTestBot/Config.pm
+++ b/testbot/lib/WineTestBot/Config.pm
@@ -37,7 +37,7 @@ use vars qw (@ISA @EXPORT @EXPORT_OK $UseSSL $LogDir $DataDir $BinDir
$TagPrefix $ProjectName $PatchesMailingList $LDAPServer
$LDAPBindDN $LDAPSearchBase $LDAPSearchFilter
$LDAPRealNameAttribute $LDAPEMailAttribute $AgentPort $Tunnel
- $TunnelDefaults $PrettyHostNames $JobPurgeDays
+ $TunnelDefaults $PrettyHostNames $DefaultIndexDays $JobPurgeDays
$WebHostName $RegistrationQ $RegistrationARE $MuninAPIKey);
require Exporter;
@@ -54,7 +54,7 @@ require Exporter;
$TagPrefix $ProjectName $PatchesMailingList
$LDAPServer $LDAPBindDN $LDAPSearchBase $LDAPSearchFilter
$LDAPRealNameAttribute $LDAPEMailAttribute $AgentPort $Tunnel
- $TunnelDefaults $PrettyHostNames $JobPurgeDays
+ $TunnelDefaults $PrettyHostNames $DefaultIndexDays $JobPurgeDays
$WebHostName $RegistrationQ $RegistrationARE $MuninAPIKey);
@EXPORT_OK = qw($DbDataSource $DbUsername $DbPassword);
@@ -149,6 +149,7 @@ $LDAPSearchFilter = undef;
$LDAPRealNameAttribute = undef;
$LDAPEMailAttribute = undef;
+$DefaultIndexDays = 4;
$JobPurgeDays = 30;
if (!$::BuildEnv)
diff --git a/testbot/web/index.pl b/testbot/web/index.pl
index cc32bdb..603f295 100644
--- a/testbot/web/index.pl
+++ b/testbot/web/index.pl
@@ -236,8 +236,8 @@ sub GetDetailsPage($)
package StatusPage;
-use ObjectModel::CGI::Page;
-our @ISA = qw(ObjectModel::CGI::Page);
+use ObjectModel::CGI::FreeFormPage;
+our @ISA = qw(ObjectModel::CGI::FreeFormPage);
use WineTestBot::Config;
use WineTestBot::Engine::Notify;
@@ -251,10 +251,31 @@ sub _initialize($$$)
{
my ($self, $Request, $RequiredRole) = @_;
+ $self->{Days} = $self->GetParam("Days");
+ $self->Validate();
+
$self->{start} = Time();
$self->SUPER::_initialize($Request, $RequiredRole);
}
+sub Validate($)
+{
+ my ($self) = @_;
+
+ if (!defined $self->{Days} or !$self->{Days})
+ {
+ $self->{Days} = $DefaultIndexDays;
+ }
+ elsif ($self->{Days} !~ /^[0-9]{1,2}$/)
+ {
+ $self->{ErrField} = "Days";
+ $self->{ErrMessage} = "The number of days must be between 1 and 99";
+ $self->{Days} = $DefaultIndexDays;
+ return undef;
+ }
+ return $self->SUPER::Validate();
+}
+
sub OutputDot($$)
{
my ($self, $DotColor) = @_;
@@ -328,12 +349,15 @@ sub GenerateBody($)
print "<h2><a name='jobs'></a>Jobs</h2>\n";
my $Jobs = CreateJobs();
+ my $CutOff = time() - $self->{Days} * 24 * 60 * 60;
+ $Jobs->AddFilter("Submitted", [$CutOff], ">=");
my $JobsCollectionBlock = new JobStatusBlock($Jobs, $self);
# We need to collect information about the tasks of all jobs except the
# pretty rare queued jobs. But doing so one job at a time is inefficient so
# do it all at once now and store the results in ...->{JobsInfo}.
my $Tasks = CreateTasks();
+ $Tasks->AddFilter("Started", [$CutOff], ">=");
foreach my $Task (@{$Tasks->GetItems()})
{
my $JobInfo = ($JobsCollectionBlock->{JobsInfo}->{$Task->JobId} ||= {});
@@ -353,6 +377,18 @@ sub GenerateBody($)
$JobsCollectionBlock->GenerateList();
+ print <<EOF;
+<p></p>
+<form id="Days" action='/' method='get'>
+ <div class='ItemProperty'><label>Show jobs for the past</label>
+ <div class='ItemValue'>
+ <input type='text' name='Days' maxlength='2' size='2' value='$self->{Days}' /> days
+ <input type='submit' value='Update'/>
+ </div>
+ </div>
+</form>
+EOF
+
print "<h2><a name='vms'></a>VMs</h2>\n";
my $VMsCollectionBlock = new VMStatusBlock(CreateVMs(), $self);
$VMsCollectionBlock->GenerateList();
@@ -361,6 +397,11 @@ sub GenerateBody($)
print "<p class='GeneralFooterText'>Generated in ", Elapsed($self->{start}), " s</p>\n";
}
+sub OnAction($$)
+{
+ my ($self, $Action) = @_;
+ return $self->Validate() ? 1 : undef;
+}
package main;
Module: tools
Branch: master
Commit: 91edb4e2ed9650cae7192694be7b4ad002ac82a6
URL: https://source.winehq.org/git/tools.git/?a=commit;h=91edb4e2ed9650cae719269…
Author: Francois Gouget <fgouget(a)codeweavers.com>
Date: Mon Mar 1 16:05:23 2021 +0100
testbot/LogUtils: Let ParseWineTestReport() do the error detection.
This reduces duplication and lets ParseWineTestReport()'s more
sophisticated analysis have the last word on which report lines contain
errors.
Signed-off-by: Francois Gouget <fgouget(a)codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard(a)winehq.org>
---
testbot/lib/WineTestBot/LogUtils.pm | 16 ----------------
1 file changed, 16 deletions(-)
diff --git a/testbot/lib/WineTestBot/LogUtils.pm b/testbot/lib/WineTestBot/LogUtils.pm
index 267dcd9..4d2619c 100644
--- a/testbot/lib/WineTestBot/LogUtils.pm
+++ b/testbot/lib/WineTestBot/LogUtils.pm
@@ -328,14 +328,6 @@ sub GetReportLineCategory($)
{
return "skip";
}
- if ($Line =~ /: Test (?:failed|succeeded inside todo block): / or
- $Line =~ /Fatal: test .* does not exist/ or
- $Line =~ / done \(258\)/ or
- $Line =~ /: unhandled exception [0-9a-fA-F]{8} (?:at|in) / or
- $Line =~ /^Unhandled exception: /)
- {
- return "error";
- }
if ($Line =~ /^[_.a-z0-9-]+:[_a-z0-9]* start / or
$Line =~ /: this is the last test seen before the exception/)
{
@@ -736,14 +728,6 @@ sub ParseWineTestReport($$$)
}
$Cur->{Rc} = $Rc;
}
- elsif (GetReportLineCategory($Line) eq "error")
- {
- # This should only happen on very garbled lines, or if there is an
- # inconsistency between GetReportLineCategory() and
- # ParseWineTestReport().
- _AddReportError($LogInfo, $Cur, $LineNo, $Line);
- }
-
}
$Cur->{IsBroken} = 1 if ($LogInfo->{TaskTimedOut});
_CloseTestUnit($LogInfo, $Cur, 1);