THRIFT-3118: add http (for non-ssl and for ssl) to the python cross tests
diff --git a/test/test.py b/test/test.py
index 24e7c4e..f59256a 100755
--- a/test/test.py
+++ b/test/test.py
@@ -52,7 +52,7 @@
CONFIG_FILE = 'tests.json'
-def run_cross_tests(server_match, client_match, jobs, skip_known_failures, retry_count, regex):
+def run_cross_tests(server_match, client_match, jobs, skip_known_failures, only_known_failures, retry_count, regex):
logger = multiprocessing.get_logger()
logger.debug('Collecting tests')
with open(path_join(TEST_DIR, CONFIG_FILE), 'r') as fp:
@@ -63,6 +63,10 @@
print(' servers: %s' % server_match, file=sys.stderr)
print(' clients: %s' % client_match, file=sys.stderr)
return False
+ if only_known_failures:
+ logger.debug('Only running known failures')
+ known = crossrunner.load_known_failures(TEST_DIR)
+ tests = list(filter(lambda t: crossrunner.test_name(**t) in known, tests))
if skip_known_failures:
logger.debug('Skipping known failures')
known = crossrunner.load_known_failures(TEST_DIR)
@@ -81,7 +85,7 @@
return False
-def run_feature_tests(server_match, feature_match, jobs, skip_known_failures, retry_count, regex):
+def run_feature_tests(server_match, feature_match, jobs, skip_known_failures, only_known_failures, retry_count, regex):
basedir = path_join(ROOT_DIR, FEATURE_DIR_RELATIVE)
logger = multiprocessing.get_logger()
logger.debug('Collecting tests')
@@ -95,6 +99,10 @@
print(' servers: %s' % server_match, file=sys.stderr)
print(' features: %s' % feature_match, file=sys.stderr)
return False
+ if only_known_failures:
+ logger.debug('Only running known failures')
+ known = crossrunner.load_known_failures(basedir)
+ tests = list(filter(lambda t: crossrunner.test_name(**t) in known, tests))
if skip_known_failures:
logger.debug('Skipping known failures')
known = crossrunner.load_known_failures(basedir)
@@ -130,6 +138,8 @@
parser.add_argument('-F', '--features', nargs='*', default=None,
help='run server feature tests instead of cross language tests')
parser.add_argument('-R', '--regex', help='test name pattern to run')
+ parser.add_argument('-o', '--only-known_failures', action='store_true', dest='only_known_failures',
+ help='only execute tests that are known to fail')
parser.add_argument('-s', '--skip-known-failures', action='store_true', dest='skip_known_failures',
help='do not execute tests that are known to fail')
parser.add_argument('-r', '--retry-count', type=int,
@@ -169,10 +179,12 @@
elif options.features is not None:
features = options.features or ['.*']
res = run_feature_tests(server_match, features, options.jobs,
- options.skip_known_failures, options.retry_count, options.regex)
+ options.skip_known_failures, options.only_known_failures,
+ options.retry_count, options.regex)
else:
res = run_cross_tests(server_match, client_match, options.jobs,
- options.skip_known_failures, options.retry_count, options.regex)
+ options.skip_known_failures, options.only_known_failures,
+ options.retry_count, options.regex)
return 0 if res else 1