Module: tools
Branch: master
Commit: 9d5bd059a2e4fa4597c3f7ce3c8104f5ba64fd29
URL: https://source.winehq.org/git/tools.git/?a=commit;h=9d5bd059a2e4fa4597c3f7c…
Author: Francois Gouget <fgouget(a)codeweavers.com>
Date: Wed Feb 12 16:02:41 2020 +0100
testbot: Identify testbot.log information and error messages.
The testbot.log error messages have no common prefix such as 'error:'
which makes them hard to identify.
Expand GetLogLineCategory() to identify the most important ones.
Signed-off-by: Francois Gouget <fgouget(a)codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard(a)winehq.org>
---
testbot/lib/WineTestBot/LogUtils.pm | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/testbot/lib/WineTestBot/LogUtils.pm b/testbot/lib/WineTestBot/LogUtils.pm
index a5c6217..2104ffa 100644
--- a/testbot/lib/WineTestBot/LogUtils.pm
+++ b/testbot/lib/WineTestBot/LogUtils.pm
@@ -86,7 +86,11 @@ sub GetLogLineCategory($)
$Line =~ /^\+ \S/ or
$Line =~ /^LANG=/ or
$Line =~ /^Running (?:the tests|WineTest) / or
- $Line =~ /^Task: (?:ok|tests|Updated)/)
+ $Line =~ /^Task: (?:ok|tests|Updated)/ or
+ # testbot.log information messages
+ $Line =~ /^----- Run / or
+ $Line =~ /^The test VM has crashed/ or # Context for an error message
+ $Line =~ /^The previous \d+ run\(s\) terminated abnormally/)
{
return "info";
}
@@ -101,7 +105,12 @@ sub GetLogLineCategory($)
$Line =~ /^Makefile:[0-9]+: recipe for target .* failed$/ or
$Line =~ /^Task: / or
# Typical perl errors
- _IsPerlError($Line))
+ _IsPerlError($Line) or
+ # The main testbot.log errors
+ $Line =~ /^An error occurred while / or
+ $Line =~ /^Could not create / or
+ $Line =~ /^Giving up after \d+ run\(s\)$/ or
+ $Line =~ /^The (?:build|task) timed out$/)
{
return "error";
}
Module: tools
Branch: master
Commit: db7c14c09529b4b0a519fa91ba0e9fa28fd79fdb
URL: https://source.winehq.org/git/tools.git/?a=commit;h=db7c14c09529b4b0a519fa9…
Author: Francois Gouget <fgouget(a)codeweavers.com>
Date: Wed Feb 12 16:02:37 2020 +0100
testbot/JobDetails: Improve the error reporting.
Clearly indicate when the log or its errors cache could not be read.
Also show a note when new errors could not be detected, either because
there is no reference WineTest results (which would typically happen
shortly after a new test configuration has been added), or because there
was an issue reading one or more of the reference reports.
And don't claim there are no errors when the task has not run yet.
Signed-off-by: Francois Gouget <fgouget(a)codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard(a)winehq.org>
---
testbot/web/JobDetails.pl | 59 +++++++++++++++++++++++++++++++++++++++------
testbot/web/WineTestBot.css | 1 +
2 files changed, 53 insertions(+), 7 deletions(-)
diff --git a/testbot/web/JobDetails.pl b/testbot/web/JobDetails.pl
index ccf3410..5a484da 100644
--- a/testbot/web/JobDetails.pl
+++ b/testbot/web/JobDetails.pl
@@ -351,6 +351,22 @@ sub GenerateFullLog($$$$)
my ($self, $Dir, $LogName, $HideLog) = @_;
my $LogInfo = LoadLogErrors("$Dir/$LogName");
+ if (defined $LogInfo->{BadLog})
+ {
+ print "<pre class='log-note'>Could not highlight new errors: ", ($LogInfo->{BadRef} || $LogInfo->{BadLog}), "</pre>\n";
+ }
+ elsif ($LogInfo->{NoRef} and !defined $LogInfo->{BadRef})
+ {
+ print "<pre class='log-note'>No WineTest results are available to detect new errors</pre>\n";
+ }
+ elsif ($LogInfo->{NoRef})
+ {
+ print "<pre class='log-note'>Could not detect new errors: $LogInfo->{BadRef}</pre>\n";
+ }
+ elsif (defined $LogInfo->{BadRef})
+ {
+ print "<pre class='log-note'>Some WineTest results could not be used to detect new errors: $LogInfo->{BadRef}</pre>\n";
+ }
my %NewLineNos;
if ($LogInfo->{ErrCount})
@@ -397,6 +413,11 @@ sub GenerateFullLog($$$$)
}
close($LogFile);
}
+ else
+ {
+ print "<pre class='log-error'><code>Unable to open '$LogName' for reading: $!</code></pre>\n";
+ $IsEmpty = 0;
+ }
# And append the extra errors
foreach my $GroupName (@{$LogInfo->{ErrGroupNames}})
@@ -535,16 +556,18 @@ EOF
{
next if ($LogName =~ /^old_/);
my $LogInfo = LoadLogErrors("$TaskDir/$LogName");
- next if (!$LogInfo->{ErrCount});
- $LogInfos->{$LogName} = $LogInfo;
+ if ($LogInfo->{ErrCount} or defined $LogInfo->{BadLog})
+ {
+ $LogInfos->{$LogName} = $LogInfo;
+ }
}
my $ShowLogName = ($ReportCount > 1 or scalar(keys %$LogInfos) > 1);
- my $LogIsEmpty = 1;
+ my $NoErrors = 1;
foreach my $LogName (@{$MoreInfo->{Logs}})
{
next if (!$LogInfos->{$LogName});
- $LogIsEmpty = 0;
+ $NoErrors = 0;
if ($ShowLogName)
{
@@ -554,6 +577,24 @@ EOF
}
my $LogInfo = $LogInfos->{$LogName};
+ if (defined $LogInfo->{BadLog})
+ {
+ my ($_Action, $Url) = $self->GetMoreInfoLink($Key, GetLogLabel($LogName), "Full", $LogName);
+ print "<pre class='log-note'>The error summary is not available (<a href='$Url'>see full log instead</a>): $LogInfo->{BadLog}</pre>\n";
+ }
+ elsif ($LogInfo->{NoRef} and !defined $LogInfo->{BadRef})
+ {
+ print "<pre class='log-note'>No WineTest results are available to detect new errors</pre>\n";
+ }
+ elsif ($LogInfo->{NoRef})
+ {
+ print "<pre class='log-note'>Could not detect new errors: $LogInfo->{BadRef}</pre>\n";
+ }
+ elsif (defined $LogInfo->{BadRef})
+ {
+ print "<pre class='log-note'>Some WineTest results could not be used to detect new errors: $LogInfo->{BadRef}</pre>\n";
+ }
+
foreach my $GroupName (@{$LogInfo->{ErrGroupNames}})
{
print "<div class='LogDllName'>$GroupName</div>\n" if ($GroupName);
@@ -576,9 +617,9 @@ EOF
print "</code></pre>\n";
}
}
-
- if ($LogIsEmpty)
+ if (!@{$MoreInfo->{Logs}})
{
+ # There is no log file or they are all empty
if ($StepTask->Status eq "canceled")
{
print "No log, task was canceled\n";
@@ -589,9 +630,13 @@ EOF
}
else
{
- print "No errors\n";
+ print "<pre class='log-note'>No result yet...</pre>\n";
}
}
+ elsif ($NoErrors)
+ {
+ print "No errors\n";
+ }
}
}
print "</div>\n";
diff --git a/testbot/web/WineTestBot.css b/testbot/web/WineTestBot.css
index 9a23f5f..3fccbd2 100644
--- a/testbot/web/WineTestBot.css
+++ b/testbot/web/WineTestBot.css
@@ -395,6 +395,7 @@ pre
.userdisabled { color: red; }
.userdeleted { color: red; }
+.log-note { font-style: italic; color: blue; }
.log-info { background-color: #d9ffcc; }
.log-skip { color: blue; }
.log-todo { color: #d08000; }
Module: tools
Branch: master
Commit: 0cbb595564267b66cd7dcfeb9316a48ce286582f
URL: https://source.winehq.org/git/tools.git/?a=commit;h=0cbb595564267b66cd7dcfe…
Author: Francois Gouget <fgouget(a)codeweavers.com>
Date: Wed Feb 12 16:02:11 2020 +0100
testbot/LogUtils: Share code between _SaveLogErrors() and _DumpErrors().
_SaveLogErrors() provides more details about the errors than the old
_DumpErrors() code did.
Signed-off-by: Francois Gouget <fgouget(a)codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard(a)winehq.org>
---
testbot/lib/WineTestBot/LogUtils.pm | 90 ++++++++++++++++---------------------
1 file changed, 39 insertions(+), 51 deletions(-)
diff --git a/testbot/lib/WineTestBot/LogUtils.pm b/testbot/lib/WineTestBot/LogUtils.pm
index 9bde76c..a5c6217 100644
--- a/testbot/lib/WineTestBot/LogUtils.pm
+++ b/testbot/lib/WineTestBot/LogUtils.pm
@@ -687,24 +687,6 @@ sub GetLogLabel($)
return defined $Label ? sprintf($Label, $Extra) : $LogFileName;
}
-
-sub _DumpErrors($$)
-{
- my ($Label, $LogInfo) = @_;
-
- print STDERR "$Label: ", join(" ", keys %$LogInfo), "\n";
- my $GroupNames = $LogInfo->{ErrGroupNames};
- print STDERR " Groups=", scalar(@$GroupNames), " [", join(",", @$GroupNames), "]\n";
- my @ErrorKeys = sort keys %{$LogInfo->{Groups}};
- print STDERR " Errors=", scalar(@ErrorKeys), " [", join(",", @ErrorKeys), "]\n";
- foreach my $GroupName (@$GroupNames)
- {
- print STDERR " [$GroupName]\n";
- my $Group = $LogInfo->{Groups}->{$GroupName};
- print STDERR " [$_]\n" for (@{$Group->{Errors}});
- }
-}
-
sub _AddLogGroup($$;$)
{
my ($LogInfo, $GroupName, $LineNo) = @_;
@@ -859,21 +841,7 @@ sub GetLogErrors($)
Loads the specified log errors file.
-The file contains two types of lines:
-* GroupName lines
- <GroupName>
- Where <GroupName> is a unique string which would typically be the name of a
- WineTest dll or program, but may also be empty or be used to specify an
- extra group errors. It must not start with a space.
-
-* Error lines
- <Space> <New> <SrcLineNo> <Error>
- Where:
- - <Space> is a space, as well as the spaces in the line above.
- - <New> is either 'n' for new errors, or 'o' for old ones.
- - <SrcLineNo> is the 1-base line number of the error in the source log file.
- If there is no source line then this should be 0.
- - <Error> is the error message.
+See _WriteLogErrors() for the format of the errors file.
Returns the errors in the same format as TagNewErrors().
@@ -949,11 +917,11 @@ sub LoadLogErrors($)
=pod
=over 12
-=item C<_SaveLogErrors()>
+=item C<_WriteLogErrors()>
-Saves the LogInfo structure to <LogName>.errors.
+Writes the LogInfo structure in text form to the specified file descriptor.
-The file contains lines of the form:
+All lines follow are of the following form:
<type> <value1> <value2>
The values depend on the <type> of the line. <type> and <value1> must not
@@ -984,6 +952,27 @@ different type.
=back
=cut
+sub _WriteLogErrors($$)
+{
+ my ($Fh, $LogInfo) = @_;
+
+ foreach my $Name ("BadRef", "NoRef")
+ {
+ next if (!defined $LogInfo->{$Name});
+ print $Fh "p $Name $LogInfo->{$Name}\n";
+ }
+ foreach my $GroupName (@{$LogInfo->{ErrGroupNames}})
+ {
+ my $Group = $LogInfo->{ErrGroups}->{$GroupName};
+ print $Fh "g $Group->{LineNo} $GroupName\n";
+ foreach my $Index (0..@{$Group->{Errors}} - 1)
+ {
+ my $IsNew = $Group->{IsNew}->[$Index] ? "n" : "o";
+ print $Fh "$IsNew $Group->{LineNos}->[$Index] $Group->{Errors}->[$Index]\n";
+ }
+ }
+}
+
sub _SaveLogErrors($)
{
my ($LogInfo) = @_;
@@ -991,21 +980,7 @@ sub _SaveLogErrors($)
my $ErrorsPath = "$LogInfo->{LogPath}.errors";
if (open(my $ErrorsFile, ">", $ErrorsPath))
{
- foreach my $Name ("BadRef", "NoRef")
- {
- next if (!defined $LogInfo->{$Name});
- print $ErrorsFile "p $Name $LogInfo->{$Name}\n";
- }
- foreach my $GroupName (@{$LogInfo->{ErrGroupNames}})
- {
- my $Group = $LogInfo->{ErrGroups}->{$GroupName};
- print $ErrorsFile "g $Group->{LineNo} $GroupName\n";
- foreach my $Index (0..@{$Group->{Errors}} - 1)
- {
- my $IsNew = $Group->{IsNew}->[$Index] ? "n" : "o";
- print $ErrorsFile "$IsNew $Group->{LineNos}->[$Index] $Group->{Errors}->[$Index]\n";
- }
- }
+ _WriteLogErrors($ErrorsFile, $LogInfo);
close($ErrorsFile);
# Set the mtime so Janitor reaps both at the same time
@@ -1015,6 +990,19 @@ sub _SaveLogErrors($)
return "Could not open '$LogInfo->{LogName}.errors' for writing: $!";
}
+sub _DumpErrors($$)
+{
+ my ($Label, $LogInfo) = @_;
+
+ print STDERR "$Label:\n";
+ foreach my $Key (sort keys %{$LogInfo})
+ {
+ next if ($Key =~ /^(?:ErrGroupNames|ErrGroups|NewCount)$/);
+ print STDERR "+ $Key $LogInfo->{$Key}\n";
+ }
+ _WriteLogErrors(*STDERR, $LogInfo);
+}
+
#
# New error detection
Module: tools
Branch: master
Commit: 9d6a892b99a8757ccc8118bcfa4d782e5f1f4264
URL: https://source.winehq.org/git/tools.git/?a=commit;h=9d6a892b99a8757ccc8118b…
Author: Francois Gouget <fgouget(a)codeweavers.com>
Date: Wed Feb 12 16:02:00 2020 +0100
testbot/Janitor: Avoid false positives when cleaning up staging.
Signed-off-by: Francois Gouget <fgouget(a)codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard(a)winehq.org>
---
testbot/bin/Janitor.pl | 17 +++++++++++++++--
1 file changed, 15 insertions(+), 2 deletions(-)
diff --git a/testbot/bin/Janitor.pl b/testbot/bin/Janitor.pl
index 0635b37..8d50349 100755
--- a/testbot/bin/Janitor.pl
+++ b/testbot/bin/Janitor.pl
@@ -273,10 +273,23 @@ if (opendir(my $dh, "$DataDir/staging"))
if ($Entry =~ /^[0-9a-f]{32}-websubmit2?_/)
{
- # These files always expire after one day
+ # We get these files whenever a developer abandons a job submission.
+ # So just delete them silently after a day.
$TTL = 1 - $Age;
}
- elsif ($Entry !~ /^[0-9a-f]{32}_(?:patch\.diff|patchset\.diff|email|winetest(?:64)?-latest\.exe|work)$/)
+ elsif ($Entry =~ /^[0-9a-f]{32}_(?:patch\.diff|patchset\.diff|email|winetest(?:64)?-latest\.exe|work)$/)
+ {
+ # Janitor can only see these files if it ran during the brief interval
+ # between their creation and them being moved out of staging, or if
+ # something prevented the latter (power loss, bug, etc). So only complain
+ # after a day to avoid false positives.
+ if ($TTL >= 1)
+ {
+ my $Deletion = defined $TTL ? " (deletion in $TTL days)" : "";
+ Error "Found an old transient file$Deletion: staging/$Entry\n"
+ }
+ }
+ else
{
my $Deletion = defined $TTL ? " (deletion in $TTL days)" : "";
Error "Found a suspicious file$Deletion: staging/$Entry\n";