Francois Gouget : testbot/VMs: Schedule jobs on offline VMs.

Alexandre Julliard julliard at winehq.org
Wed Mar 27 13:09:01 CDT 2013


Module: tools
Branch: master
Commit: e7ea34bd527a38065ddf63f6e3036f1bd09b0cf8
URL:    http://source.winehq.org/git/tools.git/?a=commit;h=e7ea34bd527a38065ddf63f6e3036f1bd09b0cf8

Author: Francois Gouget <fgouget at codeweavers.com>
Date:   Wed Mar 27 11:13:30 2013 +0100

testbot/VMs: Schedule jobs on offline VMs.

Being 'offline' is supposed to be temporary so jobs can still be
scheduled on these VMs (especially the WineTest ones). These jobs will
just be run later, once an administrator has fixed the VM.

---

 testbot/bin/CheckForWinetestUpdate.pl |    1 -
 testbot/lib/WineTestBot/Jobs.pm       |    1 -
 testbot/lib/WineTestBot/Patches.pm    |    1 -
 testbot/lib/WineTestBot/VMs.pm        |    8 ++++----
 testbot/web/Submit.pl                 |   11 ++++++-----
 5 files changed, 10 insertions(+), 12 deletions(-)

diff --git a/testbot/bin/CheckForWinetestUpdate.pl b/testbot/bin/CheckForWinetestUpdate.pl
index c8909e6..8cbcc9c 100755
--- a/testbot/bin/CheckForWinetestUpdate.pl
+++ b/testbot/bin/CheckForWinetestUpdate.pl
@@ -92,7 +92,6 @@ sub AddJob
       $VMs->AddFilter("Type", ["win32", "win64"]);
       $VMs->AddFilter("Role", ["winetest"]);
   }
-  $VMs->FilterEnabledStatus();
   foreach my $VMKey (@{$VMs->SortKeysBySortOrder($VMs->GetKeys())})
   {
     my $Task = $Tasks->Add();
diff --git a/testbot/lib/WineTestBot/Jobs.pm b/testbot/lib/WineTestBot/Jobs.pm
index 4b7d425..c6421e9 100644
--- a/testbot/lib/WineTestBot/Jobs.pm
+++ b/testbot/lib/WineTestBot/Jobs.pm
@@ -542,7 +542,6 @@ sub ScheduleJobs()
   my %Hosts;
   my $VMs = CreateVMs();
   $VMs->FilterEnabledRole();
-  $VMs->FilterEnabledStatus();
   foreach my $VM (@{$VMs->GetItems()})
   {
     my $Host = $VM->GetHost();
diff --git a/testbot/lib/WineTestBot/Patches.pm b/testbot/lib/WineTestBot/Patches.pm
index e8143ca..186398d 100644
--- a/testbot/lib/WineTestBot/Patches.pm
+++ b/testbot/lib/WineTestBot/Patches.pm
@@ -236,7 +236,6 @@ sub Submit
         $VMs = CreateVMs();
         $VMs->AddFilter("Type", $Bits eq "32" ? ["win32", "win64"] : ["win64"]);
         $VMs->AddFilter("Role", ["base"]);
-        $VMs->FilterEnabledStatus();
         if (@{$VMs->GetKeys()})
         {
           # Create the corresponding Step
diff --git a/testbot/lib/WineTestBot/VMs.pm b/testbot/lib/WineTestBot/VMs.pm
index eea9e78..826b0f6 100644
--- a/testbot/lib/WineTestBot/VMs.pm
+++ b/testbot/lib/WineTestBot/VMs.pm
@@ -180,10 +180,10 @@ next step will be to revert it to the idle snapshot so it can be used again.
 
 =item offline
 
-This VM should not be used. The WineTestBot automatically puts VMs into this
-state if errors happen when manipulating them, such as if they fail to revert,
-etc. The main web status page has a warning indicator on when some VMs are
-offline.
+An error occurred with this VM (typically it failed to revert or is not
+responding anymore), making it temporarily unusable. New jobs can still be
+added for this VM but they won't be run until an administrator fixes it.
+The main web status page has a warning indicator on when some VMs are offline.
 
 =back
 
diff --git a/testbot/web/Submit.pl b/testbot/web/Submit.pl
index 56e542d..88a27dc 100644
--- a/testbot/web/Submit.pl
+++ b/testbot/web/Submit.pl
@@ -84,10 +84,9 @@ sub GetHeaderText
     my $HeaderText = "Select the VMs on which you want to run your test.";
     my $VMs = CreateVMs();
     $VMs->AddFilter("Status", ["offline"]);
-    if (! $VMs->IsEmpty())
+    if (!$VMs->IsEmpty())
     {
-      $HeaderText .= "<br>NOTE: Some VMs are currently offline and are not " .
-                     "shown here.";
+      $HeaderText .= "<br>NOTE: Offline VMs will not be able to run your tests right away.";
     }
     return $HeaderText;
   }
@@ -237,8 +236,6 @@ sub GenerateFields
       {
           $VMs->AddFilter("Type", ["win32", "win64"]);
       }
-      # Scheduling jobs on offline VMs is not allowed
-      $VMs->FilterNotOffline();
       if ($self->{ShowAll})
       {
         # All but the retired and deleted ones
@@ -259,6 +256,10 @@ sub GenerateFields
         {
           print " (", $self->CGI->escapeHTML($VM->Description), ")";
         }
+        if ($VM->Status eq 'offline')
+        {
+          print " [offline]";
+        }
         print "</label><div class='ItemValue'><input type='checkbox' name='$FieldName'";
         if ($self->GetParam("Page") == 1 || $self->GetParam($FieldName))
         {




More information about the wine-cvs mailing list