From 33593ffdfc575310568e744e3c7dc421ee0da565 Mon Sep 17 00:00:00 2001 From: Kyr Shatskyy Date: Sat, 23 Nov 2019 20:34:54 +0100 Subject: [PATCH] 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 --- scripts/suite.py | 3 +++ teuthology/suite/__init__.py | 2 +- teuthology/suite/run.py | 4 ++++ 3 files changed, 8 insertions(+), 1 deletion(-) 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): -- 2.47.3