diff options
author | Matt Kwong <mattkwong@google.com> | 2017-10-04 11:46:36 -0700 |
---|---|---|
committer | Matt Kwong <mattkwong@google.com> | 2017-10-06 15:00:48 -0700 |
commit | a9712ba7ffb8b97c4b963ce894263914d3f42003 (patch) | |
tree | 8bd192e8774436d49cbae48a5ab061201139e2b2 /tools/run_tests/run_interop_tests.py | |
parent | 1ed8dd119571a370407534dfdf6662bb5c809d4a (diff) |
Add uploading interop result to BQ
Diffstat (limited to 'tools/run_tests/run_interop_tests.py')
-rwxr-xr-x | tools/run_tests/run_interop_tests.py | 12 |
1 files changed, 12 insertions, 0 deletions
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: |