diff options
author | 2017-05-19 14:25:01 -0700 | |
---|---|---|
committer | 2017-05-24 13:42:54 -0700 | |
commit | d14c0ea1f58c1383361abbbc177d09818a9def2f (patch) | |
tree | 77abaa2455e6a50f2c7fd703274676165f8278cb /tools/run_tests/python_utils | |
parent | 1f7103a42f0e4176596822af69be62801382ef2f (diff) |
Upload Jenkins tests results to a partitioned BQ table
Diffstat (limited to 'tools/run_tests/python_utils')
-rw-r--r-- | tools/run_tests/python_utils/upload_test_results.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/tools/run_tests/python_utils/upload_test_results.py b/tools/run_tests/python_utils/upload_test_results.py index d076d1e5a2..276fd0e083 100644 --- a/tools/run_tests/python_utils/upload_test_results.py +++ b/tools/run_tests/python_utils/upload_test_results.py @@ -45,6 +45,9 @@ import big_query_utils _DATASET_ID = 'jenkins_test_results' _DESCRIPTION = 'Test results from master job run on Jenkins' +# 90 days in milliseconds +_EXPIRATION_MS = 90 * 24 * 60 * 60 * 1000 +_PARTITION_TYPE = 'DAY' _PROJECT_ID = 'grpc-testing' _RESULTS_SCHEMA = [ ('job_name', 'STRING', 'Name of Jenkins job'), @@ -87,7 +90,8 @@ def upload_results_to_bq(resultset, bq_table, args, platform): platform: string name of platform tests were run on """ bq = big_query_utils.create_big_query() - big_query_utils.create_table(bq, _PROJECT_ID, _DATASET_ID, bq_table, _RESULTS_SCHEMA, _DESCRIPTION) + big_query_utils.create_partitioned_table(bq, _PROJECT_ID, _DATASET_ID, bq_table, _RESULTS_SCHEMA, _DESCRIPTION, + partition_type=_PARTITION_TYPE, expiration_ms= _EXPIRATION_MS) for shortname, results in six.iteritems(resultset): for result in results: |