Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions tests/infra/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,13 @@ def log_exception(args: threading.ExceptHookArgs):
class ConcurrentRunner:
threads: List[threading.Thread] = []

# Env var to filter sub-tests by exact name match. Value is a
# '|'-separated list, e.g. CR_FILTER="testname1|testname2". When set,
# only sub-tests whose name fully matches one of the entries are added.
_test_filter = (
os.environ["CR_FILTER"].split("|") if os.environ.get("CR_FILTER") else None
)

def __init__(self, add_options=None) -> None:
Comment thread
maxtropets marked this conversation as resolved.
def add(parser):
parser.add_argument(
Expand All @@ -218,6 +225,8 @@ def add(parser):
self.args = infra.e2e_args.cli_args(add=add)

def add(self, prefix, target, **args_overrides):
if self._test_filter is not None and prefix not in self._test_filter:
return
args_ = copy.deepcopy(self.args)
for k, v in args_overrides.items():
setattr(args_, k, v)
Expand Down