Skip to content

Commit f30f0b7

Browse files
benchmark runner is now properly pushing updates to github PR on every test progress
1 parent d6b183d commit f30f0b7

File tree

4 files changed

+26
-15
lines changed

4 files changed

+26
-15
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "redis-benchmarks-specification"
3-
version = "0.1.80"
3+
version = "0.1.87"
44
description = "The Redis benchmarks specification describes the cross-language/tools requirements and expectations to foster performance and observability standards around redis related technologies. Members from both industry and academia, including organizations and individuals are encouraged to contribute."
55
authors = ["filipecosta90 <[email protected]>","Redis Performance Group <[email protected]>"]
66
readme = "Readme.md"

redis_benchmarks_specification/__api__/app.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ def base():
163163
"gh_org": gh_org,
164164
}
165165
if pull_request_number is not None:
166-
fields_after["pull_request_number"] = pull_request_number
166+
fields_after["pull_request"] = pull_request_number
167167
app.logger.info(
168168
"Using event {} to trigger benchmark. final fields: {}".format(
169169
event_type, fields_after

redis_benchmarks_specification/__common__/github.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ def generate_build_finished_pr_comment(
3232
comment_body += f" - test name regex: {tests_regexp}\n"
3333
comment_body += f" - command group regex: {tests_groups_regexp}\n\n"
3434
for benchmark_stream_id in benchmark_stream_ids:
35-
benchmark_stream_id = benchmark_stream_id.decode()
35+
if not isinstance(benchmark_stream_id, str):
36+
benchmark_stream_id = benchmark_stream_id.decode()
3637
grafana_benchmark_status_link = f"https://benchmarksredisio.grafana.net/d/edsxdsrbexhc0f/ce-benchmark-run-status?orgId=1&var-benchmark_work_stream={benchmark_stream_id}"
3738
print("=============================================================")
3839
print(f"Check benchmark run status in: {grafana_benchmark_status_link}")
@@ -176,7 +177,7 @@ def markdown_progress_bar(current, total, bar_length=40):
176177

177178

178179
def generate_benchmark_started_pr_comment(
179-
benchmark_stream_ids,
180+
benchmark_stream_id,
180181
total_pending,
181182
total_benchmarks,
182183
):
@@ -189,14 +190,14 @@ def generate_benchmark_started_pr_comment(
189190

190191
completed = total_benchmarks - total_pending
191192
comment_body += (
192-
f"Status: {markdown_progress_bar(completed,total_benchmarks)} pending.\n\n"
193+
f"Status: {markdown_progress_bar(completed,total_benchmarks,80)} completed.\n\n"
193194
)
194195
comment_body += f"In total will run {total_benchmarks} benchmarks.\n"
195196
comment_body += f" - {total_pending} pending.\n"
196-
comment_body += f" - {total_pending} completed.\n"
197+
comment_body += f" - {completed} completed.\n"
197198

198-
for benchmark_stream_id in benchmark_stream_ids:
199+
if not isinstance(benchmark_stream_id, str):
199200
benchmark_stream_id = benchmark_stream_id.decode()
200-
grafana_benchmark_status_link = f"https://benchmarksredisio.grafana.net/d/edsxdsrbexhc0f/ce-benchmark-run-status?orgId=1&var-benchmark_work_stream={benchmark_stream_id}"
201-
comment_body += f"You can check a the status in detail via the [grafana link]({grafana_benchmark_status_link})"
201+
grafana_benchmark_status_link = f"https://benchmarksredisio.grafana.net/d/edsxdsrbexhc0f/ce-benchmark-run-status?orgId=1&var-benchmark_work_stream={benchmark_stream_id}"
202+
comment_body += f"You can check a the status in detail via the [grafana link]({grafana_benchmark_status_link})"
202203
return comment_body

redis_benchmarks_specification/__self_contained_coordinator__/self_contained_coordinator.py

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1039,22 +1039,28 @@ def process_self_contained_coordinator_stream(
10391039
test_result = True
10401040
total_test_suite_runs = total_test_suite_runs + 1
10411041

1042-
except:
1042+
except Exception as e:
10431043
logging.critical(
1044-
"Some unexpected exception was caught "
1045-
"during local work. Failing test...."
1044+
"Some unexpected exception was caught during local work. Failing test...."
10461045
)
1047-
logging.critical(sys.exc_info()[0])
1046+
logging.critical(f"Exception type: {type(e).__name__}")
1047+
logging.critical(f"Exception message: {str(e)}")
1048+
logging.critical("Traceback details:")
1049+
logging.critical(traceback.format_exc())
10481050
print("-" * 60)
10491051
traceback.print_exc(file=sys.stdout)
10501052
print("-" * 60)
10511053
if redis_container is not None:
10521054
logging.critical("Printing redis container log....")
1055+
10531056
print("-" * 60)
1057+
10541058
print(
10551059
redis_container.logs(stdout=True, stderr=True)
10561060
)
1061+
10571062
print("-" * 60)
1063+
10581064
test_result = False
10591065
# tear-down
10601066
logging.info("Tearing down setup")
@@ -1116,12 +1122,16 @@ def process_self_contained_coordinator_stream(
11161122
)
11171123
else:
11181124
logging.error("Missing commit information within received message.")
1119-
except:
1125+
1126+
except Exception as e:
11201127
logging.critical(
11211128
"Some unexpected exception was caught "
11221129
"during local work on stream {}. Failing test....".format(stream_id)
11231130
)
1124-
logging.critical(sys.exc_info()[0])
1131+
logging.critical(f"Exception type: {type(e).__name__}")
1132+
logging.critical(f"Exception message: {str(e)}")
1133+
logging.critical("Traceback details:")
1134+
logging.critical(traceback.format_exc())
11251135
print("-" * 60)
11261136
traceback.print_exc(file=sys.stdout)
11271137
print("-" * 60)

0 commit comments

Comments
 (0)