diff options
author | James E. King III <jking@apache.org> | 2018-03-24 16:32:02 -0400 |
---|---|---|
committer | James E. King III <jking@apache.org> | 2018-04-05 10:25:19 -0400 |
commit | 6f8c99e98170dcd4f311e755b79f7013868c64c5 (patch) | |
tree | 0d8a7a41c707815ed86d624bf81be5317a70185b /test/test.py | |
parent | a0cf38ed312a5342eb05574719485b725fa52eee (diff) | |
download | thrift-6f8c99e98170dcd4f311e755b79f7013868c64c5.tar.gz |
THRIFT-3118: add http (for non-ssl and for ssl) to the python cross tests
Diffstat (limited to 'test/test.py')
-rwxr-xr-x | test/test.py | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/test/test.py b/test/test.py index 24e7c4e47..f59256a26 100755 --- a/test/test.py +++ b/test/test.py @@ -52,7 +52,7 @@ FEATURE_DIR_RELATIVE = path_join(TEST_DIR_RELATIVE, 'features') 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 @@ def run_cross_tests(server_match, client_match, jobs, skip_known_failures, retry 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 @@ def run_cross_tests(server_match, client_match, jobs, skip_known_failures, retry 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 @@ def run_feature_tests(server_match, feature_match, jobs, skip_known_failures, re 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 @@ def main(argv): 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 @@ def main(argv): 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 |