From: Ian Jackson Date: Fri, 15 Jul 2016 14:54:17 +0000 (+0100) Subject: Job truncation: Honour runvar `truncate_testid' X-Git-Tag: openstack-v11~326 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=620182c0f25b67c0d3e9f99b8cdafc9a2550ee37;p=people%2Faperard%2Fosstest.git Job truncation: Honour runvar `truncate_testid' Nothing sets this yet. Signed-off-by: Ian Jackson --- diff --git a/sg-run-job b/sg-run-job index 0f2ac9cd..41bd1271 100755 --- a/sg-run-job +++ b/sg-run-job @@ -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]}] }