[1/5] testbot: Add new status values to distinguish bad patches, build errors and TestBot errors.
Francois Gouget
fgouget at codeweavers.com
Fri Mar 29 08:02:16 CDT 2013
Also rename the 'failed' status to 'boterror' to make its meaning clearer and avoid confusion with test failures.
---
*NOTE*:
- This patch requires a database update. See testbot/ddl/update24.sql.
- The WineTestBot server will need to be restarted to deal with the new
VM status.
- The web server may need to be restarted to pick up the updates to the
Jobs & co modules (but then it may also pick up the changes
automatically).
testbot/bin/WineRunBuild.pl | 8 ++++----
testbot/bin/WineRunReconfig.pl | 8 ++++----
testbot/bin/WineRunTask.pl | 2 +-
testbot/ddl/update24.sql | 31 +++++++++++++++++++++++++++++++
testbot/ddl/winetestbot.sql | 6 +++---
testbot/lib/WineTestBot/Jobs.pm | 10 +++++-----
testbot/lib/WineTestBot/Steps.pm | 4 ++--
testbot/lib/WineTestBot/Tasks.pm | 6 +++---
testbot/web/JobDetails.pl | 2 +-
testbot/web/WineTestBot.css | 4 +++-
testbot/web/index.pl | 6 ++++--
11 files changed, 61 insertions(+), 26 deletions(-)
create mode 100644 testbot/ddl/update24.sql
diff --git a/testbot/bin/WineRunBuild.pl b/testbot/bin/WineRunBuild.pl
index f750a0b..22018f1 100755
--- a/testbot/bin/WineRunBuild.pl
+++ b/testbot/bin/WineRunBuild.pl
@@ -55,7 +55,7 @@ sub FatalError($$$$)
close($ErrFile);
}
- $Task->Status("failed");
+ $Task->Status("boterror");
$Task->Ended(time);
$Task->Save();
$Job->UpdateStatus();
@@ -87,7 +87,7 @@ sub ProcessLog($$)
if ($1 ne "ok")
{
$Errors .= "$1\n";
- $Status = "failed";
+ $Status = ($1 eq "Patch failed to apply") ? "badpatch" : "badbuild";
}
elsif (!defined $Status)
{
@@ -98,13 +98,13 @@ sub ProcessLog($$)
if (!defined $Status)
{
- $Status = "failed";
+ $Status = "boterror";
$Errors = "Missing build status line\n";
}
}
else
{
- $Status = "failed";
+ $Status = "boterror";
$Errors = "Unable to open the log file\n";
LogMsg "Unable to open '$FullLogFileName' for reading: $!\n";
}
diff --git a/testbot/bin/WineRunReconfig.pl b/testbot/bin/WineRunReconfig.pl
index 5d9d6b3..b59332d 100755
--- a/testbot/bin/WineRunReconfig.pl
+++ b/testbot/bin/WineRunReconfig.pl
@@ -55,7 +55,7 @@ sub FatalError($$$$)
close($ErrFile);
}
- $Task->Status("failed");
+ $Task->Status("boterror");
$Task->Ended(time);
$Task->Save();
$Job->UpdateStatus();
@@ -87,7 +87,7 @@ sub ProcessLog($$)
if ($1 ne "ok")
{
$Errors .= "$1\n";
- $Status = "failed";
+ $Status = "badbuild";
}
elsif (!defined $Status)
{
@@ -98,13 +98,13 @@ sub ProcessLog($$)
if (!defined $Status)
{
- $Status = "failed";
+ $Status = "boterror";
$Errors = "Missing reconfig status line\n";
}
}
else
{
- $Status = "failed";
+ $Status = "boterror";
$Errors = "Unable to open the log file\n";
LogMsg "Unable to open '$FullLogFileName' for reading: $!\n";
}
diff --git a/testbot/bin/WineRunTask.pl b/testbot/bin/WineRunTask.pl
index 15f06e8..8db2b65 100755
--- a/testbot/bin/WineRunTask.pl
+++ b/testbot/bin/WineRunTask.pl
@@ -65,7 +65,7 @@ sub FatalError($$$$$)
link($FullErrFileName, $LatestName);
}
- $Task->Status("failed");
+ $Task->Status("boterror");
$Task->Ended(time);
$Task->Save();
$Job->UpdateStatus();
diff --git a/testbot/ddl/update24.sql b/testbot/ddl/update24.sql
new file mode 100644
index 0000000..d13310e
--- /dev/null
+++ b/testbot/ddl/update24.sql
@@ -0,0 +1,31 @@
+USE winetestbot;
+
+ALTER TABLE Jobs
+ MODIFY Status ENUM('queued', 'running', 'completed', 'failed', 'boterror', 'canceled') NOT NULL;
+
+ALTER TABLE Steps
+ MODIFY Status ENUM('queued', 'running', 'completed', 'failed', 'boterror', 'canceled', 'skipped') NOT NULL;
+
+ALTER TABLE Tasks
+ MODIFY Status ENUM('queued', 'running', 'completed', 'failed', 'boterror', 'canceled', 'skipped') NOT NULL;
+
+UPDATE Jobs
+ SET Status = 'boterror'
+ WHERE Status = 'failed';
+
+UPDATE Steps
+ SET Status = 'boterror'
+ WHERE Status = 'failed';
+
+UPDATE Tasks
+ SET Status = 'boterror'
+ WHERE Status = 'failed';
+
+ALTER TABLE Jobs
+ MODIFY Status ENUM('queued', 'running', 'completed', 'badpatch', 'badbuild', 'boterror', 'canceled') NOT NULL;
+
+ALTER TABLE Steps
+ MODIFY Status ENUM('queued', 'running', 'completed', 'badpatch', 'badbuild', 'boterror', 'canceled', 'skipped') NOT NULL;
+
+ALTER TABLE Tasks
+ MODIFY Status ENUM('queued', 'running', 'completed', 'badpatch', 'badbuild', 'boterror', 'canceled', 'skipped') NOT NULL;
diff --git a/testbot/ddl/winetestbot.sql b/testbot/ddl/winetestbot.sql
index 87be172..4fbde28 100644
--- a/testbot/ddl/winetestbot.sql
+++ b/testbot/ddl/winetestbot.sql
@@ -111,7 +111,7 @@ CREATE TABLE Jobs
BranchName VARCHAR(20) NOT NULL,
UserName VARCHAR(40) NOT NULL,
Priority INT(1) NOT NULL,
- Status ENUM('queued', 'running', 'completed', 'failed', 'canceled') NOT NULL,
+ Status ENUM('queued', 'running', 'completed', 'badpatch', 'badbuild', 'boterror', 'canceled') NOT NULL,
Remarks VARCHAR(128) NULL,
Submitted DATETIME NULL,
Ended DATETIME NULL,
@@ -129,7 +129,7 @@ CREATE TABLE Steps
JobId INT(5) NOT NULL,
No INT(2) NOT NULL,
Type ENUM('suite', 'single', 'build', 'reconfig') NOT NULL,
- Status ENUM('queued', 'running', 'completed', 'failed', 'canceled', 'skipped') NOT NULL,
+ Status ENUM('queued', 'running', 'completed', 'badpatch', 'badbuild', 'boterror', 'canceled', 'skipped') NOT NULL,
FileName VARCHAR(100) NOT NULL,
FileType ENUM('exe32', 'exe64', 'patchdlls', 'patchprograms') NOT NULL,
InStaging ENUM('Y', 'N') NOT NULL,
@@ -145,7 +145,7 @@ CREATE TABLE Tasks
JobId INT(5) NOT NULL,
StepNo INT(2) NOT NULL,
No INT(2) NOT NULL,
- Status ENUM('queued', 'running', 'completed', 'failed', 'canceled', 'skipped') NOT NULL,
+ Status ENUM('queued', 'running', 'completed', 'badpatch', 'badbuild', 'boterror', 'canceled', 'skipped') NOT NULL,
VMName VARCHAR(20) NOT NULL,
Timeout INT(4) NOT NULL,
CmdLineArg VARCHAR(256) NULL,
diff --git a/testbot/lib/WineTestBot/Jobs.pm b/testbot/lib/WineTestBot/Jobs.pm
index 8176015..35514a7 100644
--- a/testbot/lib/WineTestBot/Jobs.pm
+++ b/testbot/lib/WineTestBot/Jobs.pm
@@ -144,9 +144,9 @@ sub UpdateStatus($)
my $StepStatus = $Step->UpdateStatus($Skip);
$Has{$StepStatus} = 1;
- my $Type = $Step->Type;
- if (($StepStatus eq "failed" || $StepStatus eq "canceled") &&
- ($Type eq "build" || $Type eq "reconfig"))
+ if ($StepStatus ne "queued" && $StepStatus ne "running" &&
+ $StepStatus ne "completed" &&
+ ($Step->Type eq "build" || $Step->Type eq "reconfig"))
{
# The following steps need binaries that this one was supposed to
# produce. So skip them.
@@ -158,7 +158,7 @@ sub UpdateStatus($)
# Note that one or more tasks may have been requeued during the cleanup phase
# of the server startup. So this job may regress from 'running' back to
# 'queued'. This means all possible step status values must be considered.
- foreach my $StepStatus ("running", "failed", "canceled", "skipped", "completed", "queued")
+ foreach my $StepStatus ("running", "boterror", "badpatch", "badbuild", "canceled", "skipped", "completed", "queued")
{
if ($Has{$StepStatus})
{
@@ -339,7 +339,7 @@ BEGIN
CreateItemrefPropertyDescriptor("Branch", "Branch", !1, 1, \&CreateBranches, ["BranchName"]),
CreateItemrefPropertyDescriptor("User", "Author", !1, 1, \&WineTestBot::Users::CreateUsers, ["UserName"]),
CreateBasicPropertyDescriptor("Priority", "Priority", !1, 1, "N", 1),
- CreateEnumPropertyDescriptor("Status", "Status", !1, 1, ['queued', 'running', 'completed', 'failed', 'canceled']),
+ CreateEnumPropertyDescriptor("Status", "Status", !1, 1, ['queued', 'running', 'completed', 'badpatch', 'badbuild', 'boterror', 'canceled']),
CreateBasicPropertyDescriptor("Remarks", "Remarks", !1, !1, "A", 128),
CreateBasicPropertyDescriptor("Submitted", "Submitted", !1, !1, "DT", 19),
CreateBasicPropertyDescriptor("Ended", "Ended", !1, !1, "DT", 19),
diff --git a/testbot/lib/WineTestBot/Steps.pm b/testbot/lib/WineTestBot/Steps.pm
index 3b77262..62caaa5 100644
--- a/testbot/lib/WineTestBot/Steps.pm
+++ b/testbot/lib/WineTestBot/Steps.pm
@@ -109,7 +109,7 @@ sub UpdateStatus($$)
# Note that one or more tasks may have been requeued during the cleanup phase
# of the server startup. So this step may regress from 'running' back to
# 'queued'. This means all possible task status values must be considered.
- foreach my $TaskStatus ("running", "failed", "canceled", "skipped", "completed", "queued")
+ foreach my $TaskStatus ("running", "boterror", "badpatch", "badbuild", "canceled", "skipped", "completed", "queued")
{
if ($Has{$TaskStatus})
{
@@ -158,7 +158,7 @@ BEGIN
{
@PropertyDescriptors = (
CreateBasicPropertyDescriptor("No", "Step no", 1, 1, "N", 2),
- CreateEnumPropertyDescriptor("Status", "Status", !1, 1, ['queued', 'running', 'completed', 'failed', 'canceled', 'skipped']),
+ CreateEnumPropertyDescriptor("Status", "Status", !1, 1, ['queued', 'running', 'completed', 'badpatch', 'badbuild', 'boterror', 'canceled', 'skipped']),
CreateEnumPropertyDescriptor("Type", "Step type", !1, 1, ['suite', 'single', 'build', 'reconfig']),
CreateBasicPropertyDescriptor("FileName", "File name", !1, 1, "A", 100),
CreateEnumPropertyDescriptor("FileType", "File type", !1, 1, ['exe32', 'exe64', 'patchdlls', 'patchprograms']),
diff --git a/testbot/lib/WineTestBot/Tasks.pm b/testbot/lib/WineTestBot/Tasks.pm
index 4ca1527..c892066 100644
--- a/testbot/lib/WineTestBot/Tasks.pm
+++ b/testbot/lib/WineTestBot/Tasks.pm
@@ -164,8 +164,8 @@ sub UpdateStatus
# 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";
- $self->Status("failed");
- $Status = "failed";
+ $self->Status("boterror");
+ $Status = "boterror";
my $VM = $self->VM;
$VM->Status('dirty');
@@ -208,7 +208,7 @@ BEGIN
{
@PropertyDescriptors = (
CreateBasicPropertyDescriptor("No", "Task no", 1, 1, "N", 2),
- CreateEnumPropertyDescriptor("Status", "Status", !1, 1, ['queued', 'running', 'completed', 'failed', 'canceled', 'skipped']),
+ CreateEnumPropertyDescriptor("Status", "Status", !1, 1, ['queued', 'running', 'completed', 'badpatch', 'badbuild', 'boterror', 'canceled', 'skipped']),
CreateItemrefPropertyDescriptor("VM", "VM", !1, 1, \&CreateVMs, ["VMName"]),
CreateBasicPropertyDescriptor("Timeout", "Timeout", !1, 1, "N", 4),
CreateBasicPropertyDescriptor("CmdLineArg", "Command line args", !1, !1, "A", 256),
diff --git a/testbot/web/JobDetails.pl b/testbot/web/JobDetails.pl
index 944d178..1525636 100644
--- a/testbot/web/JobDetails.pl
+++ b/testbot/web/JobDetails.pl
@@ -119,7 +119,7 @@ sub CanRestart
my $Job = CreateJobs()->GetItem($self->{JobId});
my $Status = $Job->Status;
- if ($Status ne "failed" && $Status ne "canceled")
+ if ($Status ne "boterror" && $Status ne "canceled")
{
return "Not a failed / canceled Job";
}
diff --git a/testbot/web/WineTestBot.css b/testbot/web/WineTestBot.css
index 1007372..a64584b 100644
--- a/testbot/web/WineTestBot.css
+++ b/testbot/web/WineTestBot.css
@@ -324,6 +324,8 @@ pre
.queued { color: black; }
.running { color: blue; }
.success { color: green; }
+.badpatch { color: red; }
+.badbuild { color: red; }
.testfail { color: red; }
-.botfail { color: #e55600; }
+.boterror { color: #e55600; }
.canceled { color: black; }
diff --git a/testbot/web/index.pl b/testbot/web/index.pl
index d8eaee8..69cd368 100644
--- a/testbot/web/index.pl
+++ b/testbot/web/index.pl
@@ -93,12 +93,14 @@ sub GenerateDataCell
my %HTMLChunks = ("queued" => "<span class='queued'>queued</span>",
"running" => "<span class='running'>running</span>",
"completed" => "<span class='success'>completed</span>",
- "failed" => "<span class='botfail'>failed</span>",
+ "badpatch" => "<span class='badpatch'>bad patch</span>",
+ "badbuild" => "<span class='badbuild'>build error</span>",
+ "boterror" => "<span class='boterror'>TestBot error</span>",
"canceled" => "<span class='canceled'>canceled</span>",
);
my $Status = $Item->Status;
my $HTMLStatus = $HTMLChunks{$Status} || $Status;
- if ($Status eq "completed" || $Status eq "failed" || $Status eq "canceled")
+ if ($Status eq "completed" || $Status eq "boterror" || $Status eq "canceled")
{
my $Failures = 0;
my $HasTestResult;
--
1.7.10.4
More information about the wine-patches
mailing list