Skip to content

Commit 164db6c

Browse files
authored
[CI][Benchmarks] Fix umf benchmarks failures (#19388)
1. The `umf` benchmarks uses `GBench` to create a csv from the benhcmark's output. Mixing up `stdout` with `stderr` led to a resulting csv header resolvment to fail. 2. Fail the scripts also when any suite setup fails with `--exit-on-failure` option enabled 3. Abort scripts when no benchmarks are defined. Don't allow for creating html and markdown files in case it's not a dry run and no benchmarks were properly set up.
1 parent b5795ec commit 164db6c

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

devops/scripts/benchmarks/main.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,8 @@ def main(directory, additional_env_vars, save_name, compare_names, filter):
221221
try:
222222
s.setup()
223223
except Exception as e:
224+
if options.exit_on_failure:
225+
raise e
224226
failures[s.name()] = f"Suite setup failure: {e}"
225227
log.error(
226228
f"{type(s).__name__} setup failed. Benchmarks won't be added."
@@ -247,7 +249,7 @@ def main(directory, additional_env_vars, save_name, compare_names, filter):
247249
if benchmarks:
248250
log.info(f"Running {len(benchmarks)} benchmarks...")
249251
elif not options.dry_run:
250-
log.warning("No benchmarks to run.")
252+
raise RuntimeError("No benchmarks to run.")
251253
for benchmark in benchmarks:
252254
try:
253255
merged_env_vars = {**additional_env_vars}

devops/scripts/benchmarks/utils/utils.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,17 +65,20 @@ def run(
6565
cwd=cwd,
6666
check=True,
6767
stdout=subprocess.PIPE,
68-
stderr=subprocess.STDOUT,
68+
stderr=subprocess.PIPE,
6969
env=env,
7070
timeout=timeout,
7171
) # nosec B603
7272

7373
if result.stdout:
7474
log.debug(result.stdout.decode())
75+
if result.stderr:
76+
log.debug(result.stderr.decode())
7577

7678
return result
7779
except subprocess.CalledProcessError as e:
7880
log.error(e.stdout.decode())
81+
log.error(e.stderr.decode())
7982
raise
8083

8184

0 commit comments

Comments
 (0)