Francois Gouget : testbot/web: Show more information for running jobs on the main page.

Alexandre Julliard julliard at winehq.org
Thu Feb 18 15:46:21 CST 2021


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

Author: Francois Gouget <fgouget at codeweavers.com>
Date:   Thu Feb 18 16:15:02 2021 +0100

testbot/web: Show more information for running jobs on the main page.

The Status column of the main page now distinguishes jobs that actually
have a task running from those that merely have some completed tasks.
It also shows the running failure count for these jobs, which makes it
easier to identify those that have failures before they are completed.

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

---

 testbot/web/index.pl | 41 +++++++++++++++++++++++++++++++++++++----
 1 file changed, 37 insertions(+), 4 deletions(-)

diff --git a/testbot/web/index.pl b/testbot/web/index.pl
index c88adfc..cc32bdb 100644
--- a/testbot/web/index.pl
+++ b/testbot/web/index.pl
@@ -122,19 +122,42 @@ sub GenerateDataCell($$$$)
         );
     my $Status = $Item->Status;
     my $HTMLStatus = $HTMLChunks{$Status} || $Status;
-    if ($Status eq "completed" || $Status eq "boterror" || $Status eq "canceled")
+    if ($Status eq "completed" || $Status eq "running" || $Status eq "boterror" || $Status eq "canceled")
     {
       my $JobInfo = $self->{JobsInfo}->{$Item->Id};
-      if (!exists $JobInfo->{TestFailures})
+
+      my $FailuresPrefix;
+      if ($Status eq "completed")
+      {
+        $FailuresPrefix = "";
+      }
+      elsif ($Status ne "running")
       {
         print $HTMLStatus;
+        $FailuresPrefix = " - ";
+      }
+      elsif ($JobInfo->{IsRunning})
+      {
+        $JobInfo->{DoneTasks} ||= 0;
+        print "<span class='running'>running <small>($JobInfo->{DoneTasks}/$JobInfo->{TaskCount})</small></a>";
+        $FailuresPrefix = " - ";
       }
       else
       {
-        $HTMLStatus = $Status eq "completed" ? "" : "$HTMLStatus - ";
+        $JobInfo->{DoneTasks} ||= 0;
+        print "<span class='running'>queued <small>($JobInfo->{DoneTasks}/$JobInfo->{TaskCount})</small>";
+        $FailuresPrefix = " - ";
+      }
+
+      if (exists $JobInfo->{TestFailures})
+      {
         my $class = $JobInfo->{TestFailures} ? "testfail" : "success";
         my $s = $JobInfo->{TestFailures} == 1 ? "" : "s";
-        print "$HTMLStatus<span class='$class'>$JobInfo->{TestFailures} test failure$s</span>";
+        print "$FailuresPrefix<span class='$class'>$JobInfo->{TestFailures} test failure$s</span>";
+      }
+      elsif ($Status eq "completed")
+      {
+        print $HTMLStatus;
       }
     }
     else
@@ -314,6 +337,16 @@ sub GenerateBody($)
   foreach my $Task (@{$Tasks->GetItems()})
   {
     my $JobInfo = ($JobsCollectionBlock->{JobsInfo}->{$Task->JobId} ||= {});
+    $JobInfo->{TaskCount}++;
+    if ($Task->Status eq "running")
+    {
+      $JobInfo->{IsRunning} = 1;
+    }
+    elsif ($Task->Status ne "queued")
+    {
+      $JobInfo->{DoneTasks}++;
+    }
+
     my $TestFailures = $Task->TestFailures;
     $JobInfo->{TestFailures} += $TestFailures if (defined $TestFailures);
   }




More information about the wine-cvs mailing list