[PATCH] testbot: Remove the Step::InStaging field.

Francois Gouget fgouget at codeweavers.com
Wed Jul 11 04:34:51 CDT 2018


It has been replaced by the new Job-based staging mechanism and is not
needed anymore.

Signed-off-by: Francois Gouget <fgouget at codeweavers.com>
---

Updating the database is not absolutely necessary but getting rid of the 
InStaging is the whole point of this patch. So it's highly recommended 
to update the database. Either way the web server and TestBot Engine 
should be restarted.

 testbot/bin/CheckForWinetestUpdate.pl       |  3 ---
 testbot/ddl/update38.sql                    |  4 +++
 testbot/ddl/winetestbot.sql                 |  1 -
 testbot/doc/winetestbot-schema.dia          | 23 ----------------
 testbot/lib/WineTestBot/Engine/Scheduler.pm |  2 --
 testbot/lib/WineTestBot/Patches.pm          |  3 ---
 testbot/lib/WineTestBot/Steps.pm            | 29 ---------------------
 testbot/lib/WineTestBot/StepsTasks.pm       | 17 +-----------
 testbot/web/Submit.pl                       |  3 ---
 9 files changed, 5 insertions(+), 80 deletions(-)
 create mode 100644 testbot/ddl/update38.sql

diff --git a/testbot/bin/CheckForWinetestUpdate.pl b/testbot/bin/CheckForWinetestUpdate.pl
index a570a1b80..df5a326f5 100755
--- a/testbot/bin/CheckForWinetestUpdate.pl
+++ b/testbot/bin/CheckForWinetestUpdate.pl
@@ -207,7 +207,6 @@ sub AddJob($$$)
   $NewStep->Type("suite");
   $NewStep->FileName($LatestBaseName);
   $NewStep->FileType($Bits == 64 ? "exe64" : "exe32");
-  $NewStep->InStaging(!1);
 
   # Add a task for each VM
   my $Tasks = $NewStep->Tasks;
@@ -276,7 +275,6 @@ sub AddReconfigJob($)
   my $BuildStep = $Steps->Add();
   $BuildStep->Type("reconfig");
   $BuildStep->FileType("none");
-  $BuildStep->InStaging(!1);
 
   # And a task for each VM
   my $SortedKeys = $VMs->SortKeysBySortOrder($VMs->GetKeys());
@@ -309,7 +307,6 @@ sub AddReconfigJob($)
       $NewStep->PreviousNo($BuildStep->No);
       $NewStep->Type("suite");
       $NewStep->FileType("none");
-      $NewStep->InStaging(!1);
 
       foreach my $VMKey (@$SortedKeys)
       {
diff --git a/testbot/ddl/update38.sql b/testbot/ddl/update38.sql
new file mode 100644
index 000000000..56f7d1171
--- /dev/null
+++ b/testbot/ddl/update38.sql
@@ -0,0 +1,4 @@
+USE winetestbot;
+
+ALTER TABLE Steps
+  DROP InStaging;
diff --git a/testbot/ddl/winetestbot.sql b/testbot/ddl/winetestbot.sql
index 12b5dea1a..a6adea820 100644
--- a/testbot/ddl/winetestbot.sql
+++ b/testbot/ddl/winetestbot.sql
@@ -134,7 +134,6 @@ CREATE TABLE Steps
   Status                ENUM('queued', 'running', 'completed', 'badpatch', 'badbuild', 'boterror', 'canceled', 'skipped') NOT NULL,
   FileName              VARCHAR(100) NULL,
   FileType              ENUM('none', 'exe32', 'exe64', 'patchdlls', 'patchprograms') NOT NULL,
-  InStaging             ENUM('Y', 'N') NOT NULL,
   DebugLevel            INT(2) NOT NULL,
   ReportSuccessfulTests ENUM('Y', 'N') NOT NULL,
   PRIMARY KEY (JobId, No),
diff --git a/testbot/doc/winetestbot-schema.dia b/testbot/doc/winetestbot-schema.dia
index 0dbc7f985..d3efcb8d8 100644
--- a/testbot/doc/winetestbot-schema.dia
+++ b/testbot/doc/winetestbot-schema.dia
@@ -1875,29 +1875,6 @@
             <dia:string>##</dia:string>
           </dia:attribute>
         </dia:composite>
-        <dia:composite type="table_attribute">
-          <dia:attribute name="name">
-            <dia:string>#InStaging#</dia:string>
-          </dia:attribute>
-          <dia:attribute name="type">
-            <dia:string>#BOOL#</dia:string>
-          </dia:attribute>
-          <dia:attribute name="comment">
-            <dia:string>##</dia:string>
-          </dia:attribute>
-          <dia:attribute name="primary_key">
-            <dia:boolean val="false"/>
-          </dia:attribute>
-          <dia:attribute name="nullable">
-            <dia:boolean val="false"/>
-          </dia:attribute>
-          <dia:attribute name="unique">
-            <dia:boolean val="false"/>
-          </dia:attribute>
-          <dia:attribute name="default_value">
-            <dia:string>##</dia:string>
-          </dia:attribute>
-        </dia:composite>
         <dia:composite type="table_attribute">
           <dia:attribute name="name">
             <dia:string>#DebugLevel#</dia:string>
diff --git a/testbot/lib/WineTestBot/Engine/Scheduler.pm b/testbot/lib/WineTestBot/Engine/Scheduler.pm
index 3ed86e28d..4d944c9fd 100644
--- a/testbot/lib/WineTestBot/Engine/Scheduler.pm
+++ b/testbot/lib/WineTestBot/Engine/Scheduler.pm
@@ -572,8 +572,6 @@ sub _ScheduleTasks($)
       my $Previous = "";  # Avoid undefined values for hash indices
       if (!$Step->PreviousNo)
       {
-        # The first step may need to get files from the staging area
-        $Step->HandleStaging() if ($Step->Status eq "queued");
         $StepRank = 0;
         $StepVMs{$Step} = [];
       }
diff --git a/testbot/lib/WineTestBot/Patches.pm b/testbot/lib/WineTestBot/Patches.pm
index cafd54d46..2d553fed3 100644
--- a/testbot/lib/WineTestBot/Patches.pm
+++ b/testbot/lib/WineTestBot/Patches.pm
@@ -182,7 +182,6 @@ sub Submit($$$)
     my $BuildStep = $NewJob->Steps->Add();
     $BuildStep->FileName("patch.diff");
     $BuildStep->FileType("patchdlls");
-    $BuildStep->InStaging(!1);
     $BuildStep->Type("build");
     $BuildStep->DebugLevel(0);
 
@@ -220,7 +219,6 @@ sub Submit($$$)
             $FileName .= "64" if ($Bits eq "64");
             $NewStep->FileName("$FileName.exe");
             $NewStep->FileType("exe$Bits");
-            $NewStep->InStaging(!1);
 
             # And a task for each VM
             my $Tasks = $NewStep->Tasks;
@@ -248,7 +246,6 @@ sub Submit($$$)
     my $NewStep = $NewJob->Steps->Add();
     $NewStep->FileName("patch.diff");
     $NewStep->FileType("patchdlls");
-    $NewStep->InStaging(!1);
     $NewStep->DebugLevel(0);
 
     # And a task for each VM
diff --git a/testbot/lib/WineTestBot/Steps.pm b/testbot/lib/WineTestBot/Steps.pm
index 0159314f9..cb2c6eeb7 100644
--- a/testbot/lib/WineTestBot/Steps.pm
+++ b/testbot/lib/WineTestBot/Steps.pm
@@ -90,7 +90,6 @@ sub InitializeNew($$)
   $self->Status("queued");
   $self->Type("single");
   $self->FileType("none");
-  $self->InStaging(1);
   $self->DebugLevel(1);
   $self->ReportSuccessfulTests(!1);
 
@@ -159,33 +158,6 @@ sub GetFullFileName($)
   return $Path . $self->FileName;
 }
 
-sub HandleStaging($$)
-{
-  my ($self) = @_;
-
-  # Always at least create the step's directory
-  my $StepDir = $self->CreateDir();
-  return undef if (! $self->InStaging);
-
-  my $FileName = $self->FileName;
-  if ($FileName !~ m/^[0-9a-z-]+_(.*)$/)
-  {
-    return "Can't split staging filename";
-  }
-  my $BaseName = $1;
-  $self->FileName($BaseName);
-  my $StagingFileName = "$DataDir/staging/$FileName";
-  if (!move($StagingFileName, $self->GetFullFileName()))
-  {
-    return "Could not move the staging file: $!";
-  }
-
-  $self->InStaging(!1);
-  my ($ErrProperty, $ErrMessage) = $self->Save();
-
-  return $ErrMessage;
-}
-
 sub UpdateStatus($$)
 {
   my ($self, $Skip) = @_;
@@ -261,7 +233,6 @@ my @PropertyDescriptors = (
   CreateEnumPropertyDescriptor("Type", "Step type",  !1,  1, ['suite', 'single', 'build', 'reconfig']),
   CreateBasicPropertyDescriptor("FileName", "File name",  !1, !1, "A", 100),
   CreateEnumPropertyDescriptor("FileType", "File type",  !1,  1, ['none', 'exe32', 'exe64', 'patchdlls', 'patchprograms']),
-  CreateBasicPropertyDescriptor("InStaging", "File is in staging area", !1, 1, "B", 1),
   CreateBasicPropertyDescriptor("DebugLevel", "Debug level (WINETEST_DEBUG)", !1, 1, "N", 2),
   CreateBasicPropertyDescriptor("ReportSuccessfulTests", "Report successful tests (WINETEST_REPORT_SUCCESS)", !1, 1, "B", 1),
   CreateDetailrefPropertyDescriptor("Tasks", "Tasks", !1, !1, \&CreateTasks),
diff --git a/testbot/lib/WineTestBot/StepsTasks.pm b/testbot/lib/WineTestBot/StepsTasks.pm
index 470ce4e87..4675194e6 100644
--- a/testbot/lib/WineTestBot/StepsTasks.pm
+++ b/testbot/lib/WineTestBot/StepsTasks.pm
@@ -140,22 +140,7 @@ sub _initialize($$)
       $StepTask->Status($Task->Status);
       $StepTask->VM($Task->VM);
       $StepTask->Timeout($Task->Timeout);
-      if ($Step->InStaging)
-      {
-        my $FileName = $Step->FileName;
-        if ($FileName =~ m/^[\da-fA-F]+ (.*)$/)
-        {
-          $StepTask->FileName("$1");
-        }
-        else
-        {
-          $StepTask->FileName("unknown");
-        }
-      }
-      else
-      {
-        $StepTask->FileName($Step->FileName);
-      }
+      $StepTask->FileName($Step->FileName);
       $StepTask->FileType($Step->FileType);
       $StepTask->CmdLineArg($Task->CmdLineArg);
       $StepTask->Started($Task->Started);
diff --git a/testbot/web/Submit.pl b/testbot/web/Submit.pl
index cb6a1246f..e207d78ba 100644
--- a/testbot/web/Submit.pl
+++ b/testbot/web/Submit.pl
@@ -801,7 +801,6 @@ sub OnSubmit($)
           $BuildStep = $Steps->Add();
           $BuildStep->FileName($BaseName);
           $BuildStep->FileType($FileType);
-          $BuildStep->InStaging(!1);
           $BuildStep->Type("build");
           $BuildStep->DebugLevel(0);
 
@@ -836,7 +835,6 @@ sub OnSubmit($)
         {
           $TestStep->FileName($BaseName);
         }
-        $TestStep->InStaging(!1);
         $TestStep->FileType("exe$Bits");
         $TestStep->Type("single");
         $TestStep->DebugLevel($self->GetParam("DebugLevel"));
@@ -874,7 +872,6 @@ sub OnSubmit($)
           my $WineStep = $Steps->Add();
           $WineStep->FileName($BaseName);
           $WineStep->FileType($FileType);
-          $WineStep->InStaging(!1);
           $WineStep->Type("build");
           $WineStep->DebugLevel($self->GetParam("DebugLevel"));
           $WineStep->ReportSuccessfulTests(defined($self->GetParam("ReportSuccessfulTests")));
-- 
2.18.0




More information about the wine-devel mailing list