]> xenbits.xensource.com Git - people/iwj/osstest.git/commitdiff
sg-run-job: Honour skip_testids runvar
authorIan Jackson <ian.jackson@eu.citrix.com>
Tue, 18 Apr 2017 13:09:38 +0000 (13:09 +0000)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Tue, 18 Apr 2017 15:55:34 +0000 (16:55 +0100)
This works like truncate_testids, except that the steps which match
are never run (truncate_testids skips steps *after* matching steps,
and also doesn't skip some things like log capture).

If the programmed testid for a step ends in `(*)' to request
substitutions of the stepno, the skip matching takes place against the
unsubstituted value (since it happens before a stepno is allocated).
There is no way to skip only some of a set of steps whose testids are
distinguished only by stepno.

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

index 8cf3b9463283511390e1aa08539b240104fa6a3a..8e625d9af29f63e1a6dfcb748bbeb41041a85e27 100755 (executable)
@@ -41,14 +41,16 @@ proc per-host-finish {} {
 
 proc run-job {job} {
     global jobinfo builds flight ok truncate need_xen_hosts anyfailed
-    global nested_layers_hosts truncate_globs
+    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]
+    set skip_globs     [jobdb::read-runvar $flight $job skip_testids]
 
     set nh [need-hosts/$jobinfo(recipe)]
     if {![string compare $nh BUILD]} {
@@ -97,7 +99,7 @@ proc run-job {job} {
         }
     }
 
-    if {$truncate} {
+    if {$truncate || $anyskipped} {
        if {$ok} { setstatus truncated                                     }
        set ok 0
     }
@@ -174,7 +176,7 @@ proc iffail-check {iffail okexpr iffail_status_var} {
 }
 
 proc spawn-ts {iffail testid args} {
-    global flight c jobinfo env truncate
+    global flight c jobinfo env truncate skip_globs anyskipped
 
     if {[file exists abort]} {
         jobdb::logputs stdout \
@@ -217,6 +219,13 @@ proc spawn-ts {iffail testid args} {
     }
     regsub {/\@} $testid $host_testid_suffix testid
 
+    if {[testid_matches_globs $testid $skip_globs]} {
+        set anyskipped 1
+        jobdb::logputs stdout \
+            "skipping - not executing $flight.$jobinfo(job) $args"
+        return {imm 1} ;# reap-ts will report success
+    }
+
     jobdb::spawn-step-begin $flight $jobinfo(job) $ts stepno
     regsub {\(\*\)$} $testid ($stepno) testid