diff options
author | Nobuaki Sukegawa <nsuke@apache.org> | 2016-02-11 13:15:40 +0900 |
---|---|---|
committer | Nobuaki Sukegawa <nsuke@apache.org> | 2016-02-11 20:06:46 +0900 |
commit | 144bbef3ddd3a66ff038e5ad271500aa06b63aae (patch) | |
tree | 9df0b7b9b72cfad6784abae823b23d005c30dc97 /test/crossrunner | |
parent | d10eb082d02ecfc5206bce62961cd45e6c48656b (diff) | |
download | thrift-144bbef3ddd3a66ff038e5ad271500aa06b63aae.tar.gz |
THRIFT-3611 Add --regex filter to cross test runner
Client: Test
Patch: Nobuaki Sukegawa
This closes #843
Diffstat (limited to 'test/crossrunner')
-rw-r--r-- | test/crossrunner/collect.py | 15 | ||||
-rw-r--r-- | test/crossrunner/test.py | 4 |
2 files changed, 13 insertions, 6 deletions
diff --git a/test/crossrunner/collect.py b/test/crossrunner/collect.py index e91ac0b43..d7594cb62 100644 --- a/test/crossrunner/collect.py +++ b/test/crossrunner/collect.py @@ -22,6 +22,7 @@ import re from itertools import product from .util import merge_dict +from .test import TestEntry # Those keys are passed to execution as is. # Note that there are keys other than these, namely: @@ -144,12 +145,18 @@ def _do_collect_tests(servers, clients): } -def collect_cross_tests(tests_dict, server_match, client_match): +def _filter_entries(tests, regex): + if regex: + return filter(lambda t: re.search(regex, TestEntry.get_name(**t)), tests) + return tests + + +def collect_cross_tests(tests_dict, server_match, client_match, regex): sv, cl = _collect_testlibs(tests_dict, server_match, client_match) - return list(_do_collect_tests(sv, cl)) + return list(_filter_entries(_do_collect_tests(sv, cl), regex)) -def collect_feature_tests(tests_dict, features_dict, server_match, feature_match): +def collect_feature_tests(tests_dict, features_dict, server_match, feature_match, regex): sv, _ = _collect_testlibs(tests_dict, server_match) ft = collect_features(features_dict, feature_match) - return list(_do_collect_tests(sv, ft)) + return list(_filter_entries(_do_collect_tests(sv, ft), regex)) diff --git a/test/crossrunner/test.py b/test/crossrunner/test.py index dcc8a9416..74fd916ec 100644 --- a/test/crossrunner/test.py +++ b/test/crossrunner/test.py @@ -124,8 +124,8 @@ class TestEntry(object): return config @classmethod - def get_name(cls, server, client, proto, trans, sock, *args): - return '%s-%s_%s_%s-%s' % (server, client, proto, trans, sock) + def get_name(cls, server, client, protocol, transport, socket, *args, **kwargs): + return '%s-%s_%s_%s-%s' % (server, client, protocol, transport, socket) @property def name(self): |