Francois Gouget : testbot/web: Show TestBot start/ stop events on the Activity page.

Alexandre Julliard julliard at winehq.org
Fri Dec 22 08:49:36 CST 2017


Module: tools
Branch: master
Commit: 4bea10ac77a1a7d23118301c7c4c5e128abad252
URL:    https://source.winehq.org/git/tools.git/?a=commit;h=4bea10ac77a1a7d23118301c7c4c5e128abad252

Author: Francois Gouget <fgouget at codeweavers.com>
Date:   Fri Dec 22 01:45:02 2017 +0100

testbot/web: Show TestBot start/stop events on the Activity page.

Signed-off-by: Francois Gouget <fgouget at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 testbot/lib/WineTestBot/Activity.pm | 17 ++++++++++++++++-
 testbot/web/Activity.pl             |  8 +++++++-
 testbot/web/WineTestBot.css         |  1 +
 3 files changed, 24 insertions(+), 2 deletions(-)

diff --git a/testbot/lib/WineTestBot/Activity.pm b/testbot/lib/WineTestBot/Activity.pm
index dcc5895..38cd556 100644
--- a/testbot/lib/WineTestBot/Activity.pm
+++ b/testbot/lib/WineTestBot/Activity.pm
@@ -51,6 +51,7 @@ describing the TestBot activity. The structure is as follows:
       end      => <EndTimestamp>,
       runnable => <RunnableTasksCount>,
       queued   => <QueuedTasksCount>,
+      engine   => <StartOrStop>,
       statusvms => {
         <VMName1> => {
           vm     => <VMObject>,
@@ -102,6 +103,20 @@ sub GetActivity($)
     {
       ($Group->{runnable}, $Group->{queued}) = split / /, $Record->Value;
     }
+    elsif ($Record->Type eq "engine" and $Record->Name =~ /^(?:start|stop)$/)
+    {
+      $Group->{engine} = $Record->Name;
+      foreach my $VM (@{$VMs->GetItems()})
+      {
+        my $StatusVMs = ( $Group->{statusvms} ||= {} );
+        my $VMStatus = ( $StatusVMs->{$VM->Name} ||= {} );
+        $VMStatus->{vmstatus} = $VMStatus;
+        weaken($VMStatus->{vmstatus}); # avoid memory cycles
+        $VMStatus->{start} = $Group->{start};
+        $VMStatus->{status} = "engine";
+        $VMStatus->{rows} = 1;
+      }
+    }
     elsif ($Record->Type eq "vmstatus")
     {
       # Ignore retired / deleted VMs
@@ -165,7 +180,7 @@ sub GetActivity($)
       {
         $LastVMStatus->{end} = $VMStatus->{start} if ($LastVMStatus);
       }
-      elsif ($LastVMStatus)
+      elsif ($LastVMStatus and $LastVMStatus->{status} ne "engine")
       {
         $VMStatus = $StatusVMs->{$VM->Name} = $LastVMStatus;
         $LastStatusVMs{$VM->Name}->{$VM->Name} = {merged => 1, vmstatus => $VMStatus};
diff --git a/testbot/web/Activity.pl b/testbot/web/Activity.pl
index ca5b94c..e57ab7d 100644
--- a/testbot/web/Activity.pl
+++ b/testbot/web/Activity.pl
@@ -139,6 +139,12 @@ EOF
     next if (!$Group->{statusvms});
 
     print "<tr><td>", _GetHtmlTime($Group->{start}), "</td>";
+    if ($Group->{engine})
+    {
+      print "<td class='Record RecordEngine'>$Group->{engine}</td>\n";
+      print "<td colspan='", scalar(@SortedVMs), "'><hr></td>\n";
+      next;
+    }
     if ($Group->{runnable} or $Group->{queued})
     {
       print "<td class='Record'>", ($Group->{runnable} || 0), " / ", ($Group->{queued} || 0), "</td>";
@@ -229,7 +235,7 @@ sub GenerateFooter($)
   print "<span class='Record-running'>running</span> a task (in which case it links to it),<br>\n";
   print "<span class='Record-dirty'>dirty</span> while the server is powering off the VM after a task or while it assesses its state on startup.</p>\n";
 
-  print "<p>If no time is indicated then the VM remained in that state for less than 2 seconds. The tasks column indicates the number of runnable / queued tasks before that scheduling round.</p>\n";
+  print "<p>If no time is indicated then the VM remained in that state for less than 2 seconds. The tasks column indicates the number of runnable / queued tasks before that scheduling round. A long horizontal bar indicates the TestBot server was restarted. </p>\n";
 
   print "<p>The VM could also be <span class='Record-offline'>offline</span> due to a temporary issue,<br>\n";
   print "or until the administrator can look at it for <span class='Record-maintenance'>maintenance</span>,<br>\n";
diff --git a/testbot/web/WineTestBot.css b/testbot/web/WineTestBot.css
index e58a4d8..f0f3c01 100644
--- a/testbot/web/WineTestBot.css
+++ b/testbot/web/WineTestBot.css
@@ -344,6 +344,7 @@ a.title { color:inherit; text-decoration: none; }
 
 th.Record { text-align: center; }
 td.Record { text-align: center; }
+.RecordEngine { font-style: italic; color: #601919; }
 .RecordHost { font-size: smaller; }
 .RecordJob { font-size: smaller; }
 .RecordDuration { }




More information about the wine-cvs mailing list