Functions | Variables
python_utils.upload_rbe_results Namespace Reference

Functions

def _get_api_key ()
 
def _get_invocation_id ()
 
def _get_resultstore_data (api_key, invocation_id)
 
def _parse_test_duration (duration_str)
 
def _upload_results_to_bq (rows)
 

Variables

string _DATASET_ID = 'jenkins_test_results'
 
string _DESCRIPTION = 'Test results from master RBE builds on Kokoro'
 
int _EXPIRATION_MS = 365 * 24 * 60 * 60 * 1000
 
string _PARTITION_TYPE = 'DAY'
 
string _PROJECT_ID = 'grpc-testing'
 
list _RESULTS_SCHEMA
 
string _TABLE_ID = 'rbe_test_results'
 
 action
 
def api_key = args.api_key or _get_api_key()
 
 argp
 
 args = argp.parse_args()
 
list bq_rows = []
 
 const
 
 default
 
 f
 
 gcp_utils_dir
 
 help
 
 indent
 
def invocation_id = args.invocation_id or _get_invocation_id()
 
int MAX_ROWS = 1000
 
string result = 'FAILED'
 
def resultstore_actions = _get_resultstore_data(api_key, invocation_id)
 
 sort_keys
 
list test_cases
 
 type
 

Function Documentation

◆ _get_api_key()

def python_utils.upload_rbe_results._get_api_key ( )
private
Returns string with API key to access ResultStore.
    Intended to be used in Kokoro environment.

Definition at line 52 of file upload_rbe_results.py.

◆ _get_invocation_id()

def python_utils.upload_rbe_results._get_invocation_id ( )
private
Returns String of Bazel invocation ID. Intended to be used in
    Kokoro environment.

Definition at line 63 of file upload_rbe_results.py.

◆ _get_resultstore_data()

def python_utils.upload_rbe_results._get_resultstore_data (   api_key,
  invocation_id 
)
private
Returns dictionary of test results by querying ResultStore API.
  Args:
  api_key: String of ResultStore API key
  invocation_id: String of ResultStore invocation ID to results from 

Definition at line 114 of file upload_rbe_results.py.

◆ _parse_test_duration()

def python_utils.upload_rbe_results._parse_test_duration (   duration_str)
private
Parse test duration string in '123.567s' format

Definition at line 74 of file upload_rbe_results.py.

◆ _upload_results_to_bq()

def python_utils.upload_rbe_results._upload_results_to_bq (   rows)
private
Upload test results to a BQ table.

  Args:
  rows: A list of dictionaries containing data for each row to insert

Definition at line 84 of file upload_rbe_results.py.

Variable Documentation

◆ _DATASET_ID

string python_utils.upload_rbe_results._DATASET_ID = 'jenkins_test_results'
private

Definition at line 32 of file upload_rbe_results.py.

◆ _DESCRIPTION

string python_utils.upload_rbe_results._DESCRIPTION = 'Test results from master RBE builds on Kokoro'
private

Definition at line 33 of file upload_rbe_results.py.

◆ _EXPIRATION_MS

int python_utils.upload_rbe_results._EXPIRATION_MS = 365 * 24 * 60 * 60 * 1000
private

Definition at line 35 of file upload_rbe_results.py.

◆ _PARTITION_TYPE

string python_utils.upload_rbe_results._PARTITION_TYPE = 'DAY'
private

Definition at line 36 of file upload_rbe_results.py.

◆ _PROJECT_ID

string python_utils.upload_rbe_results._PROJECT_ID = 'grpc-testing'
private

Definition at line 37 of file upload_rbe_results.py.

◆ _RESULTS_SCHEMA

list python_utils.upload_rbe_results._RESULTS_SCHEMA
private
Initial value:
1 = [
2  ('job_name', 'STRING', 'Name of Kokoro job'),
3  ('build_id', 'INTEGER', 'Build ID of Kokoro job'),
4  ('build_url', 'STRING', 'URL of Kokoro build'),
5  ('test_target', 'STRING', 'Bazel target path'),
6  ('test_class_name', 'STRING', 'Name of test class'),
7  ('test_case', 'STRING', 'Name of test case'),
8  ('result', 'STRING', 'Test or build result'),
9  ('timestamp', 'TIMESTAMP', 'Timestamp of test run'),
10  ('duration', 'FLOAT', 'Duration of the test run'),
11 ]

Definition at line 38 of file upload_rbe_results.py.

◆ _TABLE_ID

string python_utils.upload_rbe_results._TABLE_ID = 'rbe_test_results'
private

Definition at line 49 of file upload_rbe_results.py.

◆ action

python_utils.upload_rbe_results.action

Definition at line 172 of file upload_rbe_results.py.

◆ api_key

def python_utils.upload_rbe_results.api_key = args.api_key or _get_api_key()

Definition at line 177 of file upload_rbe_results.py.

◆ argp

python_utils.upload_rbe_results.argp
Initial value:
1 = argparse.ArgumentParser(
2  description=
3  'Fetches results for given RBE invocation and uploads them to BigQuery table.'
4  )

Definition at line 150 of file upload_rbe_results.py.

◆ args

python_utils.upload_rbe_results.args = argp.parse_args()

Definition at line 175 of file upload_rbe_results.py.

◆ bq_rows

python_utils.upload_rbe_results.bq_rows = []

Definition at line 189 of file upload_rbe_results.py.

◆ const

python_utils.upload_rbe_results.const

Definition at line 173 of file upload_rbe_results.py.

◆ default

python_utils.upload_rbe_results.default

Definition at line 155 of file upload_rbe_results.py.

◆ f

python_utils.upload_rbe_results.f

Definition at line 183 of file upload_rbe_results.py.

◆ gcp_utils_dir

python_utils.upload_rbe_results.gcp_utils_dir
Initial value:
1 = os.path.abspath(
2  os.path.join(os.path.dirname(__file__), '../../gcp/utils'))

Definition at line 27 of file upload_rbe_results.py.

◆ help

python_utils.upload_rbe_results.help

Definition at line 157 of file upload_rbe_results.py.

◆ indent

python_utils.upload_rbe_results.indent

Definition at line 183 of file upload_rbe_results.py.

◆ invocation_id

def python_utils.upload_rbe_results.invocation_id = args.invocation_id or _get_invocation_id()

Definition at line 178 of file upload_rbe_results.py.

◆ MAX_ROWS

int python_utils.upload_rbe_results.MAX_ROWS = 1000

Definition at line 303 of file upload_rbe_results.py.

◆ result

string python_utils.upload_rbe_results.result = 'FAILED'

Definition at line 238 of file upload_rbe_results.py.

◆ resultstore_actions

python_utils.upload_rbe_results.resultstore_actions = _get_resultstore_data(api_key, invocation_id)

Definition at line 179 of file upload_rbe_results.py.

◆ sort_keys

python_utils.upload_rbe_results.sort_keys

Definition at line 183 of file upload_rbe_results.py.

◆ test_cases

list python_utils.upload_rbe_results.test_cases
Initial value:
1 = [{
2  'testCase': {
3  'caseName': str(action['id']['actionId']),
4  }
5  }]

Definition at line 197 of file upload_rbe_results.py.

◆ type

python_utils.upload_rbe_results.type

Definition at line 156 of file upload_rbe_results.py.

xds_interop_client.str
str
Definition: xds_interop_client.py:487


grpc
Author(s):
autogenerated on Fri May 16 2025 03:03:42