]> xenbits.xensource.com Git - osstest.git/commitdiff
sg-report-flight: Sharing reports: more task finished info
authorIan Jackson <iwj@xenproject.org>
Mon, 5 Oct 2020 17:47:12 +0000 (18:47 +0100)
committerIan Jackson <iwj@xenproject.org>
Wed, 7 Oct 2020 17:39:48 +0000 (18:39 +0100)
Other steps from jobs affecting this host either started after we are
running, and therefore didn't affect the stuff we're reporting, or
already in the db.  Furthermore, any such effects for steps which have
finished must have completed by the max finished time  But if there
are unfinished steps, we don't know the finish time.

Signed-off-by: Ian Jackson <iwj@xenproject.org>
sg-report-flight

index 8f99bb699ee1ae0b030be9e27dd4191bb427ea7f..33f953ca699677cf6533fa19411a7c63b90d4ced 100755 (executable)
@@ -1355,7 +1355,8 @@ END
     # table rows to the overall union (sum type) rows.
     my $nullcols_main = nullcols(qw(
         flight::integer job status oidents
-        started::integer rest_started::integer finished::integer
+        started::integer rest_started::integer
+        finished::integer all_finished::boolean
     ));
     my $nullcols_tasks = nullcols(qw(
         taskid::integer type refkey username comment
@@ -1382,7 +1383,11 @@ END
              (SELECT max(finished)
                 FROM steps s
                WHERE s.flight = q.flight
-                 AND s.job    = q.job)          AS finished
+                 AND s.job    = q.job)          AS finished,
+             (SELECT every(finished IS NOT NULL)
+                FROM steps s
+               WHERE s.flight = q.flight
+                 AND s.job    = q.job)          AS all_finished
        FROM Q
         ORDER BY q.tident),
 
@@ -1401,6 +1406,7 @@ END
              min(prep_started)                  AS prep_started,
              min(rest_started)                  AS rest_started,
              max(finished)                      AS finished,
+             every(all_finished)                AS all_finished,
              $nullcols_tasks,
              $nullcols_elided,
               NULL::integer                      AS sort_index
@@ -1466,7 +1472,7 @@ END
 <th>role(s)<br>(there)</td>
 <th>install / prep.<br>started</td>
 <th>use</br>started</td>
-<th>last step<br>ended</td>
+<th>last relevant step<br>ended</td>
 <th>job<br>status</td>
 </tr>
 END
@@ -1522,7 +1528,7 @@ END
              map { $_ ? show_abs_time($_) : '' }
              $srow->{prep_started},
              $srow->{rest_started},
-             !$srow->{olive} && $srow->{finished};
+             (!$srow->{olive} || $srow->{all_finished}) && $srow->{finished};
            my $info = report_run_getinfo($srow);
            print H <<END, 
 <td $info->{ColourAttr}>$info->{Content}</td>