Skip to content

Commit

Permalink
fix output html
Browse files Browse the repository at this point in the history
  • Loading branch information
evkotov committed Dec 1, 2023
1 parent 51731db commit df3cccd
Showing 1 changed file with 16 additions and 24 deletions.
40 changes: 16 additions & 24 deletions tests/model_hub_tests/performance_tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,40 +19,32 @@ def pytest_generate_tests(metafunc):
def pytest_runtest_makereport(item, call):
outcome = yield
report = outcome.get_result()
if call.when == 'teardown' and getattr(item.obj.__self__, 'result', None) is not None:
if getattr(item.obj.__self__, 'result', None) is not None:
results = item.obj.__self__.result
report._results = results


@pytest.mark.optionalhook
def pytest_html_results_table_header(cells):
cells.insert(2, html.th('status', class_="sortable"))
cells.insert(3, html.th('converted model infer time secs'))
cells.insert(4, html.th('converted model infer time variance'))
cells.insert(5, html.th('converted model heat n repeats'))
cells.insert(3, html.th('status', class_="sortable"))
cells.insert(4, html.th('converted model infer time secs'))
cells.insert(5, html.th('converted model infer time variance'))
cells.insert(6, html.th('converted model measurement n repeats'))
cells.insert(7, html.th('converted model throughput'))
cells.insert(8, html.th('read model infer time secs'))
cells.insert(9, html.th('read model infer time variance'))
cells.insert(10, html.th('read model heat n repeats'))
cells.insert(11, html.th('read model measurement n repeats'))
cells.insert(12, html.th('read model throughput'))
cells.insert(13, html.th('model infer time ratio converted_model_time/read_model_time'))
cells.insert(7, html.th('read model infer time secs'))
cells.insert(8, html.th('read model infer time variance'))
cells.insert(9, html.th('read model measurement n repeats'))
cells.insert(10, html.th('model infer time ratio converted_model_time/read_model_time'))


@pytest.mark.optionalhook
def pytest_html_results_table_row(report, cells):
if not getattr(report, '_results', None):
if getattr(report, '_results', None) is None:
return
cells.insert(2, html.td(report._results.status))
cells.insert(3, html.td(round_num(report._results.converted_model_results.infer_mean_time / (10 ** 9))))
cells.insert(4, html.td(round_num(report._results.converted_model_results.infer_variance)))
cells.insert(5, html.td(report._results.converted_model_results.heat_n_repeats))
cells.insert(3, html.td(report._results.status))
cells.insert(4, html.td(round_num(report._results.converted_model_results.infer_mean_time / (10 ** 9))))
cells.insert(5, html.td(round_num(report._results.converted_model_results.infer_variance)))
cells.insert(6, html.td(report._results.converted_model_results.infer_n_repeats))
cells.insert(7, html.td(round_num(report._results.converted_model_results.infer_throughput)))
cells.insert(8, html.td(round_num(report._results.read_model_results.infer_mean_time / (10 ** 9))))
cells.insert(9, html.td(round_num(report._results.read_model_results.infer_variance)))
cells.insert(10, html.td(report._results.read_model_results.heat_n_repeats))
cells.insert(11, html.td(report._results.read_model_results.infer_n_repeats))
cells.insert(12, html.td(round_num(report._results.read_model_results.infer_throughput)))
cells.insert(13, html.td(round_num(report._results.infer_time_ratio)))
cells.insert(7, html.td(round_num(report._results.read_model_results.infer_mean_time / (10 ** 9))))
cells.insert(8, html.td(round_num(report._results.read_model_results.infer_variance)))
cells.insert(9, html.td(report._results.read_model_results.infer_n_repeats))
cells.insert(10, html.td(round_num(report._results.infer_time_ratio)))

0 comments on commit df3cccd

Please sign in to comment.