Module: tools Branch: master Commit: 28c6e0ade18f90b5d42b9ee15edf62b939167684 URL: https://gitlab.winehq.org/winehq/tools/-/commit/28c6e0ade18f90b5d42b9ee15edf...
Author: Francois Gouget fgouget@codeweavers.com Date: Wed Oct 19 17:41:11 2022 +0200
testbot: Add a message category for warnings.
This adds support for identifying warnings (e.g. build warnings), and highlighting or reporting them.
---
testbot/bin/WineSendLog.pl | 1 + testbot/lib/WineTestBot/LogUtils.pm | 17 +++++++++++++++-- testbot/web/JobDetails.pl | 2 ++ testbot/web/WineTestBot.css | 2 ++ 4 files changed, 20 insertions(+), 2 deletions(-)
diff --git a/testbot/bin/WineSendLog.pl b/testbot/bin/WineSendLog.pl index ab7b90c0..c4024243 100755 --- a/testbot/bin/WineSendLog.pl +++ b/testbot/bin/WineSendLog.pl @@ -406,6 +406,7 @@ EOF my $Bugs = $LogInfo->{Bugs}->{$LineNo}; my $Prefix = $Bugs ? join(" ", sort { $a <=> $b } @$Bugs) : $Group->{Types}->[$MsgIndex] eq "k" ? "flk" : + $Group->{Types}->[$MsgIndex] eq "w" ? "wrn" : $Group->{IsNew}->[$MsgIndex] ? "new" : "old"; print $Sendmail "[$Prefix] $Group->{Messages}->[$MsgIndex]\n"; diff --git a/testbot/lib/WineTestBot/LogUtils.pm b/testbot/lib/WineTestBot/LogUtils.pm index da35d8d3..e60dec8a 100644 --- a/testbot/lib/WineTestBot/LogUtils.pm +++ b/testbot/lib/WineTestBot/LogUtils.pm @@ -97,6 +97,12 @@ sub GetLogLineCategory($) { return "info"; } + if (# Build messages + $Line =~ /^warning:/ or + $Line =~ /: warning:/) + { + return "warning"; + } if (# Git errors $Line =~ /^CONFLICT / or $Line =~ /^error: patch failed:/ or @@ -292,11 +298,17 @@ sub ParseTaskLog($) chomp $Line; $Line =~ s/\r+$//;
- if (GetLogLineCategory($Line) eq "error") + my $Category = GetLogLineCategory($Line); + if ($Category eq "error") { $CurGroup = _AddLogGroup($LogInfo, "", $LineNo) if (!$CurGroup); _AddLogMsg($LogInfo, $CurGroup, $Line, $LineNo, "e"); } + elsif ($Category eq "warning") + { + $CurGroup = _AddLogGroup($LogInfo, "", $LineNo) if (!$CurGroup); + _AddLogMsg($LogInfo, $CurGroup, $Line, $LineNo, "w"); + }
if ($Line eq "Task: tests") { @@ -1014,7 +1026,8 @@ sub LoadLogErrorsFromFh($$) $LogInfo->{BadLog} = "$LogInfo->{LineNo}: Got a $Type line with no group"; return $Line; } - elsif ($Type eq "e" or $Type eq "E" or $Type eq "k" or $Type eq "K") + elsif ($Type eq "e" or $Type eq "E" or $Type eq "k" or $Type eq "K" or + $Type eq "w" or $Type eq "W") { _AddLogMsg($LogInfo, $LogInfo->{CurGroup}, $Value, $Property, $Type); } diff --git a/testbot/web/JobDetails.pl b/testbot/web/JobDetails.pl index eed9eb30..0b42aea5 100644 --- a/testbot/web/JobDetails.pl +++ b/testbot/web/JobDetails.pl @@ -427,6 +427,7 @@ sub GenerateFullLog($$$$$) { $ErrCategory{$LineNo} = ($Group->{IsNew}->[$MsgIndex] ? "new" : ""). ($Group->{Types}->[$MsgIndex] eq "k" ? "flaky" : + $Group->{Types}->[$MsgIndex] eq "w" ? "warn" : "error"); $ErrFailures{$LineNo} = $Group->{Failures}->{$MsgIndex};
@@ -699,6 +700,7 @@ EOF my $Html = $self->escapeHTML($Line); my $Category = ($Group->{IsNew}->[$MsgIndex] ? "new" : ""). ($Group->{Types}->[$MsgIndex] eq "k" ? "flaky" : + $Group->{Types}->[$MsgIndex] eq "w" ? "warn" : "error"); $Html = "<span class='log-$Category'>$Html</span>"; my $FailureIds = $Group->{Failures}->{$MsgIndex}; diff --git a/testbot/web/WineTestBot.css b/testbot/web/WineTestBot.css index e686e6f5..cff299a7 100644 --- a/testbot/web/WineTestBot.css +++ b/testbot/web/WineTestBot.css @@ -400,6 +400,8 @@ pre
.log-note { font-style: italic; color: blue; } .log-info { background-color: #d9ffcc; } +.log-warn { color: green; } +.log-newwarn { color: green; font-weight: bold; } .log-skip { color: blue; } .log-todo { color: #d08000; } .log-flaky { color: magenta; }