Signed-off-by: Francois Gouget fgouget@codeweavers.com --- With this patch the WineRun{Build,Reconfig} WrapUpAndExit() functions more closely match the ones in WineRun{Task,WineTest}. And the next patch will make use of the extra TestFailures parameter. --- testbot/bin/WineRunBuild.pl | 7 +++---- testbot/bin/WineRunReconfig.pl | 7 +++---- 2 files changed, 6 insertions(+), 8 deletions(-)
diff --git a/testbot/bin/WineRunBuild.pl b/testbot/bin/WineRunBuild.pl index 8a92f88d1..13f488bd9 100755 --- a/testbot/bin/WineRunBuild.pl +++ b/testbot/bin/WineRunBuild.pl @@ -181,16 +181,15 @@ sub LogTaskError($) print STDERR "$Name0:error: ", $ErrMessage; }
-sub WrapUpAndExit($;$$$) +sub WrapUpAndExit($;$$$$) { - my ($Status, $Retry, $TimedOut, $Reason) = @_; + my ($Status, $TestFailures, $Retry, $TimedOut, $Reason) = @_; my $NewVMStatus = $Status eq 'queued' ? 'offline' : 'dirty'; my $VMResult = defined $Reason ? $Reason : $Status eq "boterror" ? "boterror" : $Status eq "queued" ? "error" : $TimedOut ? "timeout" : "";
- my $TestFailures; my $Tries = $Task->TestFailures || 0; if ($Retry) { @@ -490,4 +489,4 @@ $TA->Disconnect(); # Wrap up #
-WrapUpAndExit($NewStatus, undef, $TaskTimedOut); +WrapUpAndExit($NewStatus, undef, undef, $TaskTimedOut); diff --git a/testbot/bin/WineRunReconfig.pl b/testbot/bin/WineRunReconfig.pl index 004987f5b..212a5d383 100755 --- a/testbot/bin/WineRunReconfig.pl +++ b/testbot/bin/WineRunReconfig.pl @@ -182,9 +182,9 @@ sub LogTaskError($) print STDERR "$Name0:error: ", $ErrMessage; }
-sub WrapUpAndExit($;$$$) +sub WrapUpAndExit($;$$$$) { - my ($Status, $Retry, $TimedOut, $Reason) = @_; + my ($Status, $TestFailures, $Retry, $TimedOut, $Reason) = @_; my $NewVMStatus = $Status eq 'queued' ? 'offline' : $Status eq 'completed' ? 'idle' : 'dirty'; my $VMResult = defined $Reason ? $Reason : @@ -192,7 +192,6 @@ sub WrapUpAndExit($;$$$) $Status eq "queued" ? "error" : $TimedOut ? "timeout" : "";
- my $TestFailures; my $Tries = $Task->TestFailures || 0; if ($Retry) { @@ -567,4 +566,4 @@ if ($NewStatus eq 'completed') # In case of a regular build failure retrying is pointless. But in case of a # timeout the VM host may be less busy next time and since the snapshot is # unchanged we can retry. -WrapUpAndExit($NewStatus, $TaskTimedOut, $TaskTimedOut); +WrapUpAndExit($NewStatus, undef, $TaskTimedOut, $TaskTimedOut);
This ensures TestLauncher errors are accounted for in the task result. Builds are not expected to generate errors in task.log but if they do, they too should be accounted for.
Signed-off-by: Francois Gouget fgouget@codeweavers.com --- In particular this allows the scripts to detect and report the TestLauncher wineprefix sanity checks. --- testbot/bin/WineRunBuild.pl | 9 ++++++--- testbot/bin/WineRunReconfig.pl | 10 +++++++--- testbot/bin/WineRunTask.pl | 1 + testbot/bin/WineRunWineTest.pl | 11 ++++++++--- 4 files changed, 22 insertions(+), 9 deletions(-)
diff --git a/testbot/bin/WineRunBuild.pl b/testbot/bin/WineRunBuild.pl index 13f488bd9..8585882b7 100755 --- a/testbot/bin/WineRunBuild.pl +++ b/testbot/bin/WineRunBuild.pl @@ -385,7 +385,7 @@ if (!$Pid) # log before giving up #
-my ($NewStatus, $ErrMessage, $TAError, $TaskTimedOut); +my ($NewStatus, $ErrMessage, $TaskFailures, $TaskTimedOut, $TAError); Debug(Elapsed($Start), " Waiting for the script (", $Task->Timeout, "s timeout)\n"); if (!defined $TA->Wait($Pid, $Task->Timeout, 60)) { @@ -407,12 +407,15 @@ Debug(Elapsed($Start), " Retrieving 'Build.log'\n"); if ($TA->GetFile("Build.log", "$TaskDir/task.log")) { my $LogInfo = ParseTaskLog("$TaskDir/task.log"); + $TaskFailures ||= $LogInfo->{ErrCount}; if ($LogInfo->{Task} eq "ok") { # We must have gotten the full log and the build did succeed. - # So forget any prior error. + # So forget any prior error... $NewStatus = "completed"; $TAError = $ErrMessage = undef; + # ...but keep keep the task.log ones + $TaskFailures = $LogInfo->{ErrCount}; } elsif ($LogInfo->{Task} eq "badpatch") { @@ -489,4 +492,4 @@ $TA->Disconnect(); # Wrap up #
-WrapUpAndExit($NewStatus, undef, undef, $TaskTimedOut); +WrapUpAndExit($NewStatus, $TaskFailures, undef, $TaskTimedOut); diff --git a/testbot/bin/WineRunReconfig.pl b/testbot/bin/WineRunReconfig.pl index 212a5d383..66b2deaaf 100755 --- a/testbot/bin/WineRunReconfig.pl +++ b/testbot/bin/WineRunReconfig.pl @@ -385,7 +385,7 @@ if (!$Pid) # log before giving up #
-my ($NewStatus, $ErrMessage, $TAError, $TaskTimedOut); +my ($NewStatus, $ErrMessage, $TaskFailures, $TaskTimedOut, $TAError); Debug(Elapsed($Start), " Waiting for the script (", $Task->Timeout, "s timeout)\n"); if (!defined $TA->Wait($Pid, $Task->Timeout, 60)) { @@ -394,6 +394,7 @@ if (!defined $TA->Wait($Pid, $Task->Timeout, 60)) { $ErrMessage = "The build timed out\n"; $NewStatus = "badbuild"; + $TaskFailures = 1; $TaskTimedOut = 1; } else @@ -408,12 +409,15 @@ Debug(Elapsed($Start), " Retrieving 'Reconfig.log'\n"); if ($TA->GetFile("Reconfig.log", "$TaskDir/task.log")) { $LogInfo = ParseTaskLog("$TaskDir/task.log"); + $TaskFailures ||= $LogInfo->{ErrCount}; if ($LogInfo->{Task} eq "ok") { # We must have gotten the full log and the build did succeed. - # So forget any prior error. + # So forget any prior error... $NewStatus = "completed"; $TAError = $ErrMessage = undef; + # ...but keep keep the task.log ones + $TaskFailures = $LogInfo->{ErrCount}; } elsif (defined $LogInfo->{BadLog}) { @@ -566,4 +570,4 @@ if ($NewStatus eq 'completed') # In case of a regular build failure retrying is pointless. But in case of a # timeout the VM host may be less busy next time and since the snapshot is # unchanged we can retry. -WrapUpAndExit($NewStatus, undef, $TaskTimedOut, $TaskTimedOut); +WrapUpAndExit($NewStatus, $TaskFailures, $TaskTimedOut, $TaskTimedOut); diff --git a/testbot/bin/WineRunTask.pl b/testbot/bin/WineRunTask.pl index 148884328..bb199d126 100755 --- a/testbot/bin/WineRunTask.pl +++ b/testbot/bin/WineRunTask.pl @@ -535,6 +535,7 @@ Debug(Elapsed($Start), " Retrieving 'Task.log'\n"); if ($TA->GetFile("Task.log", "$TaskDir/task.log")) { my $LogInfo = ParseTaskLog("$TaskDir/task.log"); + $TaskFailures ||= $LogInfo->{ErrCount}; my $ErrMessage = CreateLogErrorsCache($LogInfo); LogTaskError("$ErrMessage\n") if (defined $ErrMessage); } diff --git a/testbot/bin/WineRunWineTest.pl b/testbot/bin/WineRunWineTest.pl index 3a267ace1..c9a57bb86 100755 --- a/testbot/bin/WineRunWineTest.pl +++ b/testbot/bin/WineRunWineTest.pl @@ -508,19 +508,24 @@ Debug(Elapsed($Start), " Retrieving 'Task.log'\n"); if ($TA->GetFile("Task.log", "$TaskDir/task.log")) { my $LogInfo = ParseTaskLog("$TaskDir/task.log"); + $TaskFailures ||= $LogInfo->{ErrCount}; if ($LogInfo->{Task} eq "ok") { # We must have gotten the full log and the task completed successfully # (with or without test failures). So clear any previous errors, including # $TaskFailures since there was not really a timeout after all. $NewStatus = "completed"; - $TaskFailures = $TAError = $ErrMessage = $PossibleCrash = undef; + $TAError = $ErrMessage = $PossibleCrash = undef; + # Reset the timeout error but keep the task.log ones + $TaskFailures = $LogInfo->{ErrCount}; } elsif ($LogInfo->{Task} eq "badpatch") { # This too is conclusive enough to ignore other errors. $NewStatus = "badpatch"; - $TaskFailures = $TAError = $ErrMessage = $PossibleCrash = undef; + $TAError = $ErrMessage = $PossibleCrash = undef; + # Reset the timeout error but keep the keep the task.log ones + $TaskFailures = $LogInfo->{ErrCount}; } elsif (defined $LogInfo->{BadLog}) { @@ -532,7 +537,7 @@ if ($TA->GetFile("Task.log", "$TaskDir/task.log")) $NewStatus = "badbuild"; $TaskFailures = $PossibleCrash = undef; } - elsif (!$TaskTimedOut and !defined $TAError) + elsif (!$TaskTimedOut and !defined $TAError and !$LogInfo->{ErrCount}) { # Did WineTest.pl crash? $NewStatus = "boterror";