diff --git a/.gitlab-ci/scripts/report_benchmark.py b/.gitlab-ci/scripts/report_benchmark.py index 6d0a1a9aac..64e12ccd9f 100644 --- a/.gitlab-ci/scripts/report_benchmark.py +++ b/.gitlab-ci/scripts/report_benchmark.py @@ -72,13 +72,5 @@ report.add_metric(score_metric) report.dump() -filename = re.sub(r"[^\w\.\\\/]", "_", os.environ["CI_JOB_NAME"]) -path = "artifacts/reports/" + filename + ".yml" -with open(path, "r") as f: - log = [l.strip() for l in f.readlines()] -for index, line in enumerate(log): - if "MHz" in line or "cycles" in line: - print(log[index + 1], log[index]) - if report.failed: sys.exit(1) diff --git a/.gitlab-ci/scripts/report_builder.py b/.gitlab-ci/scripts/report_builder.py index e932ad3ade..a07c735db0 100644 --- a/.gitlab-ci/scripts/report_builder.py +++ b/.gitlab-ci/scripts/report_builder.py @@ -172,12 +172,19 @@ def to_doc(self): def dump(self, path=None): """ - Create report file + Print results and create report file By default the output path is build from $CI_JOB_NAME """ + for metric in self.metrics: + print(metric.values) + if path is None: - filename = re.sub(r'[^\w\.\\\/]', '_', os.environ["CI_JOB_NAME"]) - path = 'artifacts/reports/'+filename+'.yml' - with open(path, 'w') as f: - yaml.dump(self.to_doc(), f) + ci_job_name = os.environ.get("CI_JOB_NAME") + if ci_job_name is not None: + filename = re.sub(r'[^\w\.\\\/]', '_', ci_job_name) + path = 'artifacts/reports/'+filename+'.yml' + + if path is not None: + with open(path, 'w') as f: + yaml.dump(self.to_doc(), f)