Skip to content

Commit

Permalink
benchmark: fix naming to avoid web report inconsistency (#543)
Browse files Browse the repository at this point in the history
Otherwise the naming looks weird in the html report because we rely on
splitting `-`. As such, when a testfile has `-` in the name it goes into
the project name in the web report. This fixes it.

Ref:
https://github.com/google/oss-fuzz-gen/blob/feb19caf287d0a1cbdd13af70e56b3f91997a7c9/report/common.py#L513

---------

Signed-off-by: David Korczynski <[email protected]>
  • Loading branch information
DavidKorczynski authored Aug 16, 2024
1 parent feb19ca commit 87b6d32
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions experiment/benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ def from_yaml(cls, benchmark_path: str) -> List:
for test_file in test_files:
max_len = os.pathconf('/', 'PC_NAME_MAX') - len('output-')
test_file_path = test_file.get('test_file_path')
normalized_test_path = test_file_path.replace("/",
"_").replace(".", "_")
normalized_test_path = test_file_path.replace('/', '_').replace(
'.', '_').replace('-', '_')
truncated_id = f'{project_name}-{normalized_test_path}'[:max_len]

benchmarks.append(
Expand Down

0 comments on commit 87b6d32

Please sign in to comment.