Skip to content

Commit

Permalink
Merge 345c58f into 1e172ec
Browse files Browse the repository at this point in the history
  • Loading branch information
naspirato authored Dec 23, 2024
2 parents 1e172ec + 345c58f commit 88cf196
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions .github/scripts/analytics/upload_tests_results.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,9 +218,9 @@ def main():
test_results_file, build_type, job_name, job_id, commit, branch, pull, run_timestamp
)
result_with_owners = get_codeowners_for_tests(codeowners, results)
prepared_for_update_rows = []
prepared_for_upload_rows = []
for index, row in enumerate(result_with_owners):
prepared_for_update_rows.append({
prepared_for_upload_rows.append({
'branch': row['branch'],
'build_type': row['build_type'],
'commit': row['commit'],
Expand All @@ -240,15 +240,19 @@ def main():
'test_id': f"{row['pull']}_{row['run_timestamp']}_{index}",
'test_name': row['test_name'],
})
print(f'upserting runs: {len(prepared_for_update_rows)} rows')
if prepared_for_update_rows:
print(f'upserting runs: {len(prepared_for_upload_rows)} rows')
if prepared_for_upload_rows:
batch_rows_for_upload_size = 1000
with ydb.SessionPool(driver) as pool:
create_tables(pool, test_table_name)
bulk_upsert(driver.table_client, full_path,
prepared_for_update_rows)
print('tests updated')
for start in range(0, len(prepared_for_upload_rows), batch_rows_for_upload_size):
batch_rows_for_upload = prepared_for_upload_rows[start:start + batch_rows_for_upload_size]
bulk_upsert(driver.table_client, full_path,
batch_rows_for_upload)

print('tests uploaded')
else:
print('nothing to upsert')
print('nothing to upload')



Expand Down

0 comments on commit 88cf196

Please sign in to comment.