]> xenbits.xensource.com Git - people/aperard/osstest.git/commitdiff
Job truncation: Honour runvar `truncate_testid'
authorIan Jackson <ian.jackson@eu.citrix.com>
Fri, 15 Jul 2016 14:54:17 +0000 (15:54 +0100)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Mon, 18 Jul 2016 14:22:22 +0000 (15:22 +0100)
Nothing sets this yet.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
sg-run-job

index 0f2ac9cdd4a65a0aa140ffc8b50f437ff5b36484..41bd127183d998ac4b46c8d1d7968510587e022e 100755 (executable)
@@ -40,13 +40,15 @@ proc per-host-finish {} {
 
 proc run-job {job} {
     global jobinfo builds flight ok truncate need_xen_hosts anyfailed
-    global nested_layers_hosts
+    global nested_layers_hosts truncate_at
 
     set ok 1
     set truncate 0
     set anyfailed 0
     jobdb::prepare $job
 
+    set truncate_at [jobdb::read-runvar $flight $job truncate_testid]
+
     set nh [need-hosts/$jobinfo(recipe)]
     if {![string compare $nh BUILD]} {
         set need_xen_hosts {}
@@ -237,6 +239,8 @@ proc spawn-ts {iffail testid args} {
 }
 
 proc reap-ts {reap} {
+    global truncate truncate_at
+
     switch -exact [lindex $reap 0] {
         imm { return [lindex $reap 1] }
         fh { }
@@ -257,6 +261,10 @@ proc reap-ts {reap} {
 
     eval jobdb::step-set-status [lrange $details 0 2] $result
     jobdb::logputs stdout "finished $detstr $result $emsg"
+    if {![string compare $testid $truncate_at]} {
+        jobdb::logputs stdout "truncating job now as instructed"
+        set truncate 1
+    }
     return [expr {![string compare $result pass]}]
 }