Module: tools Branch: master Commit: 1d497afe25f3f633134e2a491b65af62cc0aa83e URL: http://source.winehq.org/git/tools.git/?a=commit;h=1d497afe25f3f633134e2a491...
Author: Francois Gouget fgouget@codeweavers.com Date: Wed Oct 11 16:15:30 2017 +0200
testbot: Fix Tasks to not use WineTestBot::Log.
The perl modules should return error messages to the callers and let them deal with logging. So don't import WineTestBot::Log globally to ensure any logging really is deliberate.
Signed-off-by: Francois Gouget fgouget@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
testbot/lib/WineTestBot/Tasks.pm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/testbot/lib/WineTestBot/Tasks.pm b/testbot/lib/WineTestBot/Tasks.pm index 3dd5f13..401e275 100644 --- a/testbot/lib/WineTestBot/Tasks.pm +++ b/testbot/lib/WineTestBot/Tasks.pm @@ -40,7 +40,6 @@ use WineTestBot::Config; use WineTestBot::Jobs; use WineTestBot::Steps; use WineTestBot::WineTestBotObjects; -use WineTestBot::Log;
use vars qw(@ISA @EXPORT);
@@ -109,6 +108,7 @@ sub Run($$) } elsif (!$Pid) { + require WineTestBot::Log; # Capture Perl errors in the task's generic error log my ($JobId, $StepNo, $TaskNo) = @{$self->GetMasterKey()}; my $TaskDir = "$DataDir/jobs/$JobId/$StepNo/$TaskNo"; @@ -124,12 +124,11 @@ sub Run($$) } else { - LogMsg "unable to redirect stderr to '$TaskDir/err': $!\n"; + WineTestBot::Log::LogMsg("unable to redirect stderr to '$TaskDir/err': $!\n"); } $ENV{PATH} = "/usr/bin:/bin"; delete $ENV{ENV}; exec("$BinDir/${ProjectName}$RunScript", "--log-only", $JobId, $StepNo, $TaskNo) or - require WineTestBot::Log; WineTestBot::Log::LogMsg("Unable to exec ${ProjectName}$RunScript: $!\n"); exit(1); } @@ -173,7 +172,8 @@ sub UpdateStatus($$) umask($OldUMask); # This probably indicates a bug in the task script. # Don't requeue the task to avoid an infinite loop. - LogMsg "Child process for task $JobId/$StepNo/$TaskNo died unexpectedly\n"; + require WineTestBot::Log; + WineTestBot::Log::LogMsg("Child process for task $JobId/$StepNo/$TaskNo died unexpectedly\n"); $self->Status("boterror"); $Status = "boterror";