wip
This commit is contained in:
@@ -63,13 +63,12 @@ def collect_benchmark_results(base_folder, pr_folder):
|
||||
return results
|
||||
|
||||
def main():
|
||||
if len(sys.argv) != 4:
|
||||
if len(sys.argv) != 3:
|
||||
print("Usage: python post_benchmark_results.py <base_folder> <pr_folder>")
|
||||
exit(1)
|
||||
|
||||
base_folder = sys.argv[1]
|
||||
pr_folder = sys.argv[2]
|
||||
run_number = sys.argv[3]
|
||||
|
||||
benchmark_results = collect_benchmark_results(base_folder, pr_folder)
|
||||
|
||||
@@ -79,23 +78,23 @@ def main():
|
||||
|
||||
markdown_table = create_markdown_table(benchmark_results)
|
||||
new_benchmark_section = f"""
|
||||
<!-- BENCHMARK_RESULTS_START {run_number} -->
|
||||
<!-- BENCHMARK_RESULTS_START -->
|
||||
<details><summary><h2>Benchmark Results</h2></summary>
|
||||
|
||||
{markdown_table}
|
||||
</details>
|
||||
<!-- BENCHMARK_RESULTS_END {run_number} -->
|
||||
<!-- BENCHMARK_RESULTS_END -->
|
||||
"""
|
||||
|
||||
# if re.search(r'<!-- BENCHMARK_RESULTS_START -->.*<!-- BENCHMARK_RESULTS_END -->', pr_body, re.DOTALL):
|
||||
# updated_body = re.sub(
|
||||
# r'<!-- BENCHMARK_RESULTS_START -->.*<!-- BENCHMARK_RESULTS_END -->',
|
||||
# new_benchmark_section,
|
||||
# pr_body,
|
||||
# flags=re.DOTALL
|
||||
# )
|
||||
# else:
|
||||
updated_body = f"{pr_body}\n\n{new_benchmark_section}" if len(pr_body) > 0 else new_benchmark_section
|
||||
if re.search(r'<!-- BENCHMARK_RESULTS_START -->.*<!-- BENCHMARK_RESULTS_END -->', pr_body, re.DOTALL):
|
||||
updated_body = re.sub(
|
||||
r'<!-- BENCHMARK_RESULTS_START -->.*<!-- BENCHMARK_RESULTS_END -->',
|
||||
new_benchmark_section,
|
||||
pr_body,
|
||||
flags=re.DOTALL
|
||||
)
|
||||
else:
|
||||
updated_body = f"{pr_body}\n\n{new_benchmark_section}" if len(pr_body) > 0 else new_benchmark_section
|
||||
|
||||
update_pr_description(REPO_OWNER, REPO_NAME, PR_NUMBER, updated_body)
|
||||
print("PR description updated successfully.")
|
||||
@@ -103,4 +102,4 @@ def main():
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
main()
|
||||
@@ -81,7 +81,6 @@ function run_benchmarks_for_folder {
|
||||
echo "Running osrm-contract"
|
||||
measure_peak_ram_and_time "$BINARIES_FOLDER/osrm-contract $FOLDER/data.osrm" "$RESULTS_FOLDER/osrm_contract.bench"
|
||||
|
||||
|
||||
for ALGORITHM in ch mld; do
|
||||
for BENCH in nearest table trip route match; do
|
||||
echo "Running random $BENCH $ALGORITHM"
|
||||
|
||||
Reference in New Issue
Block a user