Skip to content

Commit

Permalink
[dv] Handle missing paths when producing regression log
Browse files Browse the repository at this point in the history
It's possible for a TestRunResult to contain an entry that has a path to
a build/run artifact but for that to be None rather than an actual path.
This causes the collect_results.py script to fail.

With this change such paths will be described as 'MISSING' in the
regression log instead.
  • Loading branch information
GregAC committed Feb 5, 2024
1 parent 3dbffa3 commit 9cde647
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions dv/uvm/core_ibex/scripts/report_lib/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,12 @@ def gen_test_run_result_text(trr: TestRunResult) -> str:
test_underline = '-' * len(test_name_idx)
info_lines: List[str] = [test_name_idx, test_underline]

# Filter out relevant fields, and print as relative to the dir_test for readability
lesskeys = {k: str(v.relative_to(trr.dir_test)) # Improve readability
for k, v in dataclasses.asdict(trr).items()
if k in ['binary', 'rtl_log', 'rtl_trace', 'iss_cosim_trace']}
# Filter out relevant fields, and print as relative to the dir_test for
# readability.
lesskeys = \
{k: str(v.relative_to(trr.dir_test) if v is not None else 'MISSING')
for k, v in dataclasses.asdict(trr).items()
if k in ['binary', 'rtl_log', 'rtl_trace', 'iss_cosim_trace']}
strdict = ibex_lib.format_dict_to_printable_dict(lesskeys)

trr_yaml = io.StringIO()
Expand Down

0 comments on commit 9cde647

Please sign in to comment.