From 15945049b280118ccf453a93f7520be43519c90a Mon Sep 17 00:00:00 2001 From: Greg Chadwick Date: Thu, 1 Feb 2024 16:25:54 +0000 Subject: [PATCH] [dv] Handle missing paths when producing regression log 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. --- dv/uvm/core_ibex/scripts/report_lib/util.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/dv/uvm/core_ibex/scripts/report_lib/util.py b/dv/uvm/core_ibex/scripts/report_lib/util.py index f6a00756c2..55cb1d74d9 100644 --- a/dv/uvm/core_ibex/scripts/report_lib/util.py +++ b/dv/uvm/core_ibex/scripts/report_lib/util.py @@ -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()