From fd99700c5b58e40ed2aad7985b4d002f73ca5f66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Stolarczuk?= Date: Mon, 30 Dec 2024 13:30:25 +0100 Subject: [PATCH] [Bench] Fix bench result's template path paths are relative to the place where the script was run from. --- scripts/benchmarks/output_html.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/benchmarks/output_html.py b/scripts/benchmarks/output_html.py index 9c09602354..d6d908b139 100644 --- a/scripts/benchmarks/output_html.py +++ b/scripts/benchmarks/output_html.py @@ -4,6 +4,8 @@ # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception import re +import os +from pathlib import Path import matplotlib.pyplot as plt import mpld3 from collections import defaultdict @@ -256,7 +258,9 @@ def generate_html(benchmark_runs: list[BenchmarkRun], github_repo: str, compare_ suite_names = {t.suite for t in timeseries} suite_checkboxes_html = ' '.join(f'' for suite in suite_names) - with open('benchmark_results.html.template', 'r') as file: + script_path = os.path.dirname(os.path.realpath(__file__)) + results_template_path = Path(script_path, 'benchmark_results.html.template') + with open(results_template_path, 'r') as file: html_template = file.read() template = Template(html_template)