diff options
author | Craig Tiller <ctiller@google.com> | 2017-06-07 12:22:41 -0700 |
---|---|---|
committer | Craig Tiller <ctiller@google.com> | 2017-06-07 12:22:41 -0700 |
commit | dfd7a4dc0da88b63710ce51e61b827fe0af3ffce (patch) | |
tree | a8aa7803c98a3bfc86442334b3bed9dfe94ff481 /tools/run_tests | |
parent | 00a8c0bb6865b93ca8f13e849a7eb9976453fee5 (diff) | |
parent | b89a100d69f9d975ba58a6e152354ad9614b7f96 (diff) |
Merge github.com:grpc/grpc into ALL-the-things
Diffstat (limited to 'tools/run_tests')
-rwxr-xr-x | tools/run_tests/run_interop_tests.py | 23 | ||||
-rwxr-xr-x | tools/run_tests/run_tests.py | 46 |
2 files changed, 68 insertions, 1 deletions
diff --git a/tools/run_tests/run_interop_tests.py b/tools/run_tests/run_interop_tests.py index 6da7b85430..b0435e53e3 100755 --- a/tools/run_tests/run_interop_tests.py +++ b/tools/run_tests/run_interop_tests.py @@ -202,6 +202,28 @@ class JavaLanguage: return 'java' +class JavaOkHttpClient: + + def __init__(self): + self.client_cwd = '../grpc-java' + self.safename = 'java' + + def client_cmd(self, args): + return ['./run-test-client.sh', '--use_okhttp=true'] + args + + def cloud_to_prod_env(self): + return {} + + def global_env(self): + return {} + + def unimplemented_test_cases(self): + return _SKIP_COMPRESSION + _SKIP_DATA_FRAME_PADDING + + def __str__(self): + return 'javaokhttp' + + class GoLanguage: def __init__(self): @@ -489,6 +511,7 @@ _LANGUAGES = { 'csharpcoreclr' : CSharpCoreCLRLanguage(), 'go' : GoLanguage(), 'java' : JavaLanguage(), + 'javaokhttp' : JavaOkHttpClient(), 'node' : NodeLanguage(), 'php' : PHPLanguage(), 'php7' : PHP7Language(), diff --git a/tools/run_tests/run_tests.py b/tools/run_tests/run_tests.py index 204ed5c397..1155893328 100755 --- a/tools/run_tests/run_tests.py +++ b/tools/run_tests/run_tests.py @@ -65,6 +65,10 @@ try: except (ImportError): pass # It's ok to not import because this is only necessary to upload results to BQ. +gcp_utils_dir = os.path.abspath(os.path.join( + os.path.dirname(__file__), '../gcp/utils')) +sys.path.append(gcp_utils_dir) + _ROOT = os.path.abspath(os.path.join(os.path.dirname(sys.argv[0]), '../..')) os.chdir(_ROOT) @@ -73,7 +77,6 @@ _FORCE_ENVIRON_FOR_WRAPPERS = { 'GRPC_VERBOSITY': 'DEBUG', } - _POLLING_STRATEGIES = { 'linux': ['epollsig', 'poll', 'poll-cv'], # TODO(ctiller, sreecha): enable epoll1, epollex, epoll-thread-pool @@ -81,6 +84,35 @@ _POLLING_STRATEGIES = { } +def get_flaky_tests(limit=None): + import big_query_utils + + bq = big_query_utils.create_big_query() + query = """ + SELECT + test_name, + SUM(result != 'PASSED' + AND result != 'SKIPPED') AS count_failed, + FROM + [grpc-testing:jenkins_test_results.aggregate_results] + WHERE + timestamp >= DATE_ADD(DATE(CURRENT_TIMESTAMP()), -1, "WEEK") + AND NOT REGEXP_MATCH(job_name, '.*portability.*') + AND REGEXP_MATCH(job_name, '.*master.*') + GROUP BY + test_name + HAVING + count_failed > 0""" + if limit: + query += " limit {}".format(limit) + query_job = big_query_utils.sync_query_job(bq, 'grpc-testing', query) + page = bq.jobs().getQueryResults( + pageToken=None, + **query_job['jobReference']).execute(num_retries=3) + flake_names = [row['f'][0]['v'] for row in page['rows']] + return flake_names + + def platform_string(): return jobset.platform_string() @@ -119,6 +151,9 @@ class Config(object): actual_environ = self.environ.copy() for k, v in environ.items(): actual_environ[k] = v + if not flaky and shortname and shortname in flaky_tests: + print('Setting %s to flaky' % shortname) + flaky = True return jobset.JobSpec(cmdline=self.tool_prefix + cmdline, shortname=shortname, environ=actual_environ, @@ -1212,8 +1247,17 @@ argp.add_argument('--bq_result_table', type=str, nargs='?', help='Upload test results to a specified BQ table.') +argp.add_argument('--auto_set_flakes', default=True, type=bool, + help='Set flakiness data from historic data') args = argp.parse_args() +flaky_tests = set() +if args.auto_set_flakes: + try: + flaky_tests = set(get_flaky_tests()) + except: + print("Unexpected error getting flaky tests:", sys.exc_info()[0]) + if args.force_default_poller: _POLLING_STRATEGIES = {} |