From: Kyr Shatskyy Date: Sat, 23 Nov 2019 19:34:54 +0000 (+0100) Subject: suite: add --filter-all parameter X-Git-Tag: 1.1.0~115^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F1366%2Fhead;p=teuthology.git suite: add --filter-all parameter 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 --- diff --git a/scripts/suite.py b/scripts/suite.py index c8b921f01..d6d4f43ea 100644 --- a/scripts/suite.py +++ b/scripts/suite.py @@ -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. diff --git a/teuthology/suite/__init__.py b/teuthology/suite/__init__.py index 910812ab1..c35456d54 100644 --- a/teuthology/suite/__init__.py +++ b/teuthology/suite/__init__.py @@ -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: diff --git a/teuthology/suite/run.py b/teuthology/suite/run.py index 2a421d5f1..249d289b2 100644 --- a/teuthology/suite/run.py +++ b/teuthology/suite/run.py @@ -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):