]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
suite: add --filter-all parameter 1366/head
authorKyr Shatskyy <kyrylo.shatskyy@gmail.com>
Sat, 23 Nov 2019 19:34:54 +0000 (20:34 +0100)
committerKyr Shatskyy <kyrylo.shatskyy@suse.com>
Tue, 12 May 2020 02:00:37 +0000 (04:00 +0200)
Add --filter-all parameter to 'teuthology-suite' to allow
precise test case selection. The --filter-in makes use of filter list
with logical 'or' operation to include test cases.
The --filter-out takes filter list and excludes any test case which
match any from the filter list.

This patch provides with 'and' logical operation for a given filter list.

Signed-off-by: Kyr Shatskyy <kyrylo.shatskyy@suse.com>
scripts/suite.py
teuthology/suite/__init__.py
teuthology/suite/run.py

index c8b921f01c4494482d3a6399206122a9e4a8829e..d6d4f43eab07e4a57819bc7d3efcce91a3e23f2b 100644 (file)
@@ -118,6 +118,9 @@ Scheduler arguments:
   --filter-out KEYWORDS       Do not run jobs whose description contains any of
                               the keywords in the comma separated keyword
                               string specified.
+  --filter-all KEYWORDS       Only run jobs whose description contains each one
+                              of the keywords in the comma separated keyword
+                              string specified.
   --archive-upload RSYNC_DEST Rsync destination to upload archives.
   --archive-upload-url URL    Public facing URL where archives are uploaded.
   --throttle SLEEP            When scheduling, wait SLEEP seconds between jobs.
index 910812ab11dd04329b13375509c201d0bf63d4d6..c35456d5455a868773565b1c114ee720c48197af 100644 (file)
@@ -65,7 +65,7 @@ def process_args(args):
         elif key == 'subset' and value is not None:
             # take input string '2/3' and turn into (2, 3)
             value = tuple(map(int, value.split('/')))
-        elif key in ('filter_in', 'filter_out', 'rerun_statuses'):
+        elif key in ('filter_all', 'filter_in', 'filter_out', 'rerun_statuses'):
             if not value:
                 value = []
             else:
index 2a421d5f1e608fec4c580291d2ec8b0ab3af1d21..249d289b21a77d1c9c06680d8a9b3cf45702b48b 100644 (file)
@@ -379,6 +379,10 @@ class Run(object):
                 if any(f in path for path in base_frag_paths):
                     return True
                 return False
+            filter_all = self.args.filter_all
+            if filter_all:
+                if not all(matches(f) for f in filter_all):
+                    continue
             filter_in = self.args.filter_in
             if filter_in:
                 if not any(matches(f) for f in filter_in):