[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [OSSTEST PATCH 12/15] sg-run-job: Abolish `anyfailed'



This is very similar to !$ok.

anyfailed is set to 1 only by catching-otherwise, which also then sets
ok to 0.  The differences are solely some sites which set ok to 0
without setting anyfailed to 1:
 (i) In run-job, if there are escaped steps
 (ii) In run-job, if any steps were not run due to the skip_testids
      or truncate_testids runvars
      job is being truncated due to
 (iii) If a per-host-ts step fails

The only places where anyfailed was used were:

 * To decide whether to do log capture in build jobs.  This happens
   before (i) and (ii); and (iii) is not applicable because it only
   applies if $need_xen_hosts is nonempty which is never true if
   $need_build_host is false.  We can simply use $ok instead,
   without any functional change.

 * In printing a message to stdout at the end of the job.
   We update this use site to use $ok and change the message
   accordingly.

So overall, no functional change other than to a message in the
transcript.

Signed-off-by: Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
---
 sg-run-job | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/sg-run-job b/sg-run-job
index 654ba83..b1f94f4 100755
--- a/sg-run-job
+++ b/sg-run-job
@@ -40,13 +40,12 @@ proc per-host-finish {} {
 }
 
 proc run-job {job} {
-    global jobinfo builds flight ok truncate need_xen_hosts anyfailed
+    global jobinfo builds flight ok truncate need_xen_hosts
     global nested_layers_hosts truncate_globs skip_globs anyskipped
 
     set ok 1
     set truncate 0
     set anyskipped 0
-    set anyfailed 0
     jobdb::prepare $job
 
     set truncate_globs [jobdb::read-runvar $flight $job truncate_testids]
@@ -96,7 +95,7 @@ proc run-job {job} {
         set need_xen_hosts [lunappend nested_layers_hosts]
     }
 
-    if {$need_build_host && $anyfailed} {
+    if {$need_build_host && !$ok} {
        run-ts  !broken capture-logs      ts-logs-capture + host
     }
 
@@ -119,8 +118,8 @@ proc run-job {job} {
 
     if {$need_build_host && $ok} { jobdb::preserve-task 90 }
 
-    if {$anyfailed} {
-        jobdb::logputs stdout "at least one test failed"
+    if {!$ok} {
+        jobdb::logputs stdout "job not ok"
     }
 }
 
@@ -128,9 +127,9 @@ proc catching-otherwise {failst script} {
     # Executes $script.
     # If job is already a failure (ie not $ok), skips it (ie does nothing).
     # If any Tcl exception is thrown, declares the job a failure.
-    # (ie sets job status to $failst, and sets anyfailed to 1 and ok to 0)
+    # (ie sets job status to $failst, and sets ok to 0)
 
-    global anyfailed flight jobinfo ok
+    global flight jobinfo ok
 
     if {!$ok} return
 
@@ -139,7 +138,6 @@ proc catching-otherwise {failst script} {
     } emsg]} {
         jobdb::logputs stderr "$flight.$jobinfo(job) $script failed: $emsg"
         set ok 0
-        set anyfailed 1
        setstatus $failst
     }
 }
-- 
2.1.4


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.