Signed-off-by: Francois Gouget fgouget@codeweavers.com --- testbot/bin/WineSendLog.pl | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/testbot/bin/WineSendLog.pl b/testbot/bin/WineSendLog.pl index 37949e45f..5affba606 100755 --- a/testbot/bin/WineSendLog.pl +++ b/testbot/bin/WineSendLog.pl @@ -247,7 +247,7 @@ EOF print $Sendmail "\nYou can also see the results at:\n$JobURL\n\n";
# Print the job summary - my ($JobErrors, $ReportCounts); + my $JobErrors; foreach my $Key (@SortedKeys) { my $StepTask = $StepsTasks->GetItem($Key); @@ -329,7 +329,6 @@ EOF { next if (!$JobErrors->{$Key}->{HasErrors}); my $StepTask = $StepsTasks->GetItem($Key); - my $TaskDir = $StepTask->GetTaskDir();
# Note: We could check $StepTask->Status for TestBot errors. However, # whether they are caused by the patch or not, they prevent the TestBot
This avoids having to look up the object in every loop.
Signed-off-by: Francois Gouget fgouget@codeweavers.com --- testbot/bin/WineSendLog.pl | 38 ++++++++++++++++---------------------- 1 file changed, 16 insertions(+), 22 deletions(-)
diff --git a/testbot/bin/WineSendLog.pl b/testbot/bin/WineSendLog.pl index 5affba606..8e2048e23 100755 --- a/testbot/bin/WineSendLog.pl +++ b/testbot/bin/WineSendLog.pl @@ -183,7 +183,7 @@ sub SendLog($) }
my $StepsTasks = CreateStepsTasks(undef, $Job); - my @SortedKeys = sort { $a <=> $b } @{$StepsTasks->GetKeys()}; + my $SortedStepsTasks = $StepsTasks->GetSortedItems();
my $JobURL = MakeOfficialURL("/JobDetails.pl?Key=". $Job->GetKey());
@@ -228,10 +228,8 @@ Content-Disposition: inline
VM Status Failures Command EOF - foreach my $Key (@SortedKeys) + foreach my $StepTask (@$SortedStepsTasks) { - my $StepTask = $StepsTasks->GetItem($Key); - my $TestFailures = $StepTask->TestFailures; $TestFailures = "" if (!defined $TestFailures); my $Status = $StepTask->Status; @@ -248,19 +246,18 @@ EOF
# Print the job summary my $JobErrors; - foreach my $Key (@SortedKeys) + foreach my $StepTask (@$SortedStepsTasks) { - my $StepTask = $StepsTasks->GetItem($Key); + my $Id = $StepTask->Id; my $TaskDir = $StepTask->GetTaskDir(); - my $LogNames = GetLogFileNames($TaskDir); - $JobErrors->{$Key}->{LogNames} = $LogNames; + $JobErrors->{$Id}->{LogNames} = $LogNames; foreach my $LogName (@$LogNames) { my $LogInfo = LoadLogErrors("$TaskDir/$LogName"); next if (!defined $LogInfo->{BadLog} and !$LogInfo->{ErrCount}); - $JobErrors->{$Key}->{HasErrors} = 1; - $JobErrors->{$Key}->{$LogName} = $LogInfo; + $JobErrors->{$Id}->{HasErrors} = 1; + $JobErrors->{$Id}->{$LogName} = $LogInfo;
print $Sendmail "\n=== ", GetTitle($StepTask, $LogName), " ===\n"; print $Sendmail "$LogInfo->{BadLog}\n" if (defined $LogInfo->{BadLog}); @@ -275,12 +272,11 @@ EOF }
# Print the log attachments - foreach my $Key (@SortedKeys) + foreach my $StepTask (@$SortedStepsTasks) { - my $StepTask = $StepsTasks->GetItem($Key); my $TaskDir = $StepTask->GetTaskDir();
- foreach my $LogName (@{$JobErrors->{$Key}->{LogNames}}) + foreach my $LogName (@{$JobErrors->{$StepTask->Id}->{LogNames}}) { print $Sendmail <<"EOF";
@@ -325,19 +321,19 @@ EOF # However in practice this would only be an issue if the patch reintroduced # an error that just disappeared in the latest Wine which is highly unlikely. my @Messages; - foreach my $Key (@SortedKeys) + foreach my $StepTask (@$SortedStepsTasks) { - next if (!$JobErrors->{$Key}->{HasErrors}); - my $StepTask = $StepsTasks->GetItem($Key); + my $Id = $StepTask->Id; + next if (!$JobErrors->{$Id}->{HasErrors});
# Note: We could check $StepTask->Status for TestBot errors. However, # whether they are caused by the patch or not, they prevent the TestBot # from checking for new errors which justifies sending an email to the # mailing list so that the patch receives greater scrutiny.
- foreach my $LogName (@{$JobErrors->{$Key}->{LogNames}}) + foreach my $LogName (@{$JobErrors->{$Id}->{LogNames}}) { - my $LogInfo = $JobErrors->{$Key}->{$LogName}; + my $LogInfo = $JobErrors->{$Id}->{$LogName}; # Skip if there are no errors next if (!$LogInfo->{NewCount});
@@ -428,12 +424,10 @@ EOF DebugTee($Result, "Job-ID: ". $Job->Id ."\n"); DebugTee($Result, "URL: $JobURL\n");
- foreach my $Key (@SortedKeys) + foreach my $StepTask (@$SortedStepsTasks) { - my $StepTask = $StepsTasks->GetItem($Key); my $TaskDir = $StepTask->GetTaskDir(); - - foreach my $LogName (@{$JobErrors->{$Key}->{LogNames}}) + foreach my $LogName (@{$JobErrors->{$StepTask->Id}->{LogNames}}) { print $Result "=== ", GetTitle($StepTask, $LogName), " ===\n"; DumpLogAndErr($Result, "$TaskDir/$LogName");
The logs can be pretty big, causing the email to exceed typical email size limits and cause bounces. The logs can be downloaded from the website anyway.
Signed-off-by: Francois Gouget fgouget@codeweavers.com --- testbot/bin/WineSendLog.pl | 47 +++----------------------------------- 1 file changed, 3 insertions(+), 44 deletions(-)
diff --git a/testbot/bin/WineSendLog.pl b/testbot/bin/WineSendLog.pl index 8e2048e23..9351d5d6f 100755 --- a/testbot/bin/WineSendLog.pl +++ b/testbot/bin/WineSendLog.pl @@ -51,9 +51,6 @@ use WineTestBot::StepsTasks; use WineTestBot::Utils;
-my $PART_BOUNDARY = "==13F70BD1-BA1B-449A-9CCB-B6A8E90CED47=="; - - # # Logging and error handling helpers # @@ -216,18 +213,9 @@ sub SendLog($) print $Sendmail "In-Reply-To: ", $Job->Patch->MessageId, "\n"; print $Sendmail "References: ", $Job->Patch->MessageId, "\n"; } - print $Sendmail <<"EOF"; -MIME-Version: 1.0 -Content-Type: multipart/mixed; boundary="$PART_BOUNDARY" - ---$PART_BOUNDARY -Content-Type: text/plain; charset="UTF-8" -MIME-Version: 1.0 -Content-Transfer-Encoding: 8bit -Content-Disposition: inline
-VM Status Failures Command -EOF + print $Sendmail "\n"; + print $Sendmail "VM Status Failures Command\n"; foreach my $StepTask (@$SortedStepsTasks) { my $TestFailures = $StepTask->TestFailures; @@ -242,7 +230,7 @@ EOF $TestFailures, $Cmd; }
- print $Sendmail "\nYou can also see the results at:\n$JobURL\n\n"; + print $Sendmail "\nThe full results can be found at:\n$JobURL\n\n";
# Print the job summary my $JobErrors; @@ -271,35 +259,6 @@ EOF } }
- # Print the log attachments - foreach my $StepTask (@$SortedStepsTasks) - { - my $TaskDir = $StepTask->GetTaskDir(); - - foreach my $LogName (@{$JobErrors->{$StepTask->Id}->{LogNames}}) - { - print $Sendmail <<"EOF"; - ---$PART_BOUNDARY -Content-Type: text/plain; charset="UTF-8" -MIME-Version: 1.0 -Content-Transfer-Encoding: 8bit -EOF - # Prepend the VM name to get unique attachment filenames for this email. - print $Sendmail "Content-Disposition: attachment; filename=", - $StepTask->VM->Name, "-$LogName\n\n"; - if ($Debug) - { - print $Sendmail "Not dumping logs in debug mode\n"; - } - else - { - DumpLogAndErr($Sendmail, "$TaskDir/$LogName"); - } - } - } - - print $Sendmail "\n--$PART_BOUNDARY--\n"; close($Sendmail);
# This is all for jobs submitted from the website