From a9712ba7ffb8b97c4b963ce894263914d3f42003 Mon Sep 17 00:00:00 2001 From: Matt Kwong Date: Wed, 4 Oct 2017 11:46:36 -0700 Subject: Add uploading interop result to BQ --- tools/run_tests/run_interop_tests.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'tools/run_tests/run_interop_tests.py') diff --git a/tools/run_tests/run_interop_tests.py b/tools/run_tests/run_interop_tests.py index 1537641aee..192f8e76eb 100755 --- a/tools/run_tests/run_interop_tests.py +++ b/tools/run_tests/run_interop_tests.py @@ -35,6 +35,11 @@ import traceback import python_utils.dockerjob as dockerjob import python_utils.jobset as jobset import python_utils.report_utils as report_utils +# It's ok to not import because this is only necessary to upload results to BQ. +try: + from python_utils.upload_test_results import upload_interop_results_to_bq +except ImportError as e: + print(e) # Docker doesn't clean up after itself, so we do it on exit. atexit.register(lambda: subprocess.call(['stty', 'echo'])) @@ -956,6 +961,11 @@ argp.add_argument('--internal_ci', const=True, help=('Put reports into subdirectories to improve ' 'presentation of results by Internal CI.')) +argp.add_argument('--bq_result_table', + default='', + type=str, + nargs='?', + help='Upload test results to a specified BQ table.') args = argp.parse_args() servers = set(s for s in itertools.chain.from_iterable(_SERVERS @@ -1205,6 +1215,8 @@ try: num_failures, resultset = jobset.run(jobs, newline_on_success=True, maxjobs=args.jobs, skip_jobs=args.manual_run) + if args.bq_result_table and resultset: + upload_interop_results_to_bq(resultset, args.bq_result_table, args) if num_failures: jobset.message('FAILED', 'Some tests failed', do_newline=True) else: -- cgit v1.2.3