aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools
diff options
context:
space:
mode:
authorGravatar Matt Kwong <mattkwong@google.com>2017-06-07 14:21:15 -0700
committerGravatar Matt Kwong <mattkwong@google.com>2017-06-09 14:17:35 -0700
commitea1fa277f049a51b899b41a43b85c691497c83b3 (patch)
tree951eaacd14dfaea1a91e76ae669da9f3466da58b /tools
parentc7d9c804966d12d852d08f4f132c716846a10ece (diff)
Add Kokoro metadata to BQ upload
Diffstat (limited to 'tools')
-rwxr-xr-xtools/run_tests/dockerize/build_docker_and_run_tests.sh3
-rw-r--r--tools/run_tests/python_utils/upload_test_results.py11
2 files changed, 10 insertions, 4 deletions
diff --git a/tools/run_tests/dockerize/build_docker_and_run_tests.sh b/tools/run_tests/dockerize/build_docker_and_run_tests.sh
index 6e6074b5af..eea00da821 100755
--- a/tools/run_tests/dockerize/build_docker_and_run_tests.sh
+++ b/tools/run_tests/dockerize/build_docker_and_run_tests.sh
@@ -66,6 +66,9 @@ docker run \
-e "BUILD_ID=$BUILD_ID" \
-e "BUILD_URL=$BUILD_URL" \
-e "JOB_BASE_NAME=$JOB_BASE_NAME" \
+ -e "KOKORO_BUILD_NUMBER=$KOKORO_BUILD_NUMBER" \
+ -e "KOKORO_BUILD_URL=$KOKORO_BUILD_URL" \
+ -e "KOKORO_JOB_NAME=$KOKORO_JOB_NAME" \
-i $TTY_FLAG \
--sysctl net.ipv6.conf.all.disable_ipv6=0 \
-v ~/.config/gcloud:/root/.config/gcloud \
diff --git a/tools/run_tests/python_utils/upload_test_results.py b/tools/run_tests/python_utils/upload_test_results.py
index 2ed3283310..54153c9fd2 100644
--- a/tools/run_tests/python_utils/upload_test_results.py
+++ b/tools/run_tests/python_utils/upload_test_results.py
@@ -50,10 +50,12 @@ _RESULTS_SCHEMA = [
def _get_build_metadata(test_results):
- """Add Jenkins build metadata to test_results based on environment variables set by Jenkins."""
- build_id = os.getenv('BUILD_ID')
- build_url = os.getenv('BUILD_URL')
- job_name = os.getenv('JOB_BASE_NAME')
+ """Add Jenkins/Kokoro build metadata to test_results based on environment
+ variables set by Jenkins/Kokoro.
+ """
+ build_id = os.getenv('BUILD_ID') or os.getenv('KOKORO_BUILD_NUMBER')
+ build_url = os.getenv('BUILD_URL') or os.getenv('KOKORO_BUILD_URL')
+ job_name = os.getenv('JOB_BASE_NAME') or os.getenv('KOKORO_JOB_NAME')
if build_id:
test_results['build_id'] = build_id
@@ -62,6 +64,7 @@ def _get_build_metadata(test_results):
if job_name:
test_results['job_name'] = job_name
+
def upload_results_to_bq(resultset, bq_table, args, platform):
"""Upload test results to a BQ table.