Skip to content

Commit

Permalink
fix incorrect line and byte count benchmarks (#695)
Browse files Browse the repository at this point in the history
Fixed incorrect line and byte count in  the benchmarks when using `globpath` in the configuration file.

closes #694

Authors:
  - Bhargav Suryadevara (https://github.com/bsuryadevara)

Approvers:
  - Michael Demoret (https://github.com/mdemoret-nv)

URL: #695
  • Loading branch information
bsuryadevara authored Feb 13, 2023
1 parent 6810784 commit 8dbc1ba
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,11 @@ def pytest_benchmark_update_json(config, benchmarks, output_json):
output_json["machine_info"]["gpu_" + str(i)]["temperature"] = f"{gpu.temperature} C"
output_json["machine_info"]["gpu_" + str(i)]["uuid"] = gpu.uuid

line_count = 0
byte_count = 0

for bench in output_json['benchmarks']:

line_count = 0
byte_count = 0

if "file_path" in PIPELINES_CONF[bench["name"]]:
source_file = PIPELINES_CONF[bench["name"]]["file_path"]
source_file = path.join(curr_dir, source_file)
Expand Down
6 changes: 4 additions & 2 deletions tests/benchmarks/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,11 @@ def pytest_benchmark_update_json(config, benchmarks, output_json):
output_json["machine_info"]["gpu_" + str(i)]["temperature"] = f"{gpu.temperature} C"
output_json["machine_info"]["gpu_" + str(i)]["uuid"] = gpu.uuid

line_count = 0
byte_count = 0
for bench in output_json['benchmarks']:

line_count = 0
byte_count = 0

if "file_path" in E2E_TEST_CONFIGS[bench["name"]]:
source_file = E2E_TEST_CONFIGS[bench["name"]]["file_path"]
line_count = len(open(source_file).readlines())
Expand Down

0 comments on commit 8dbc1ba

Please sign in to comment.