From 51242dc940dc44a04a33399444f2e2cc787731ed Mon Sep 17 00:00:00 2001 From: Ashish Sharma Date: Wed, 19 Nov 2025 13:30:24 +0000 Subject: [PATCH 1/2] Fix duplicate GUID override and add subtest description mapping MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit • added extraction of sub_Test_Description from edk2-test-parser logs (first column) • updated SCT logs_to_json to match subtests using (EntryPointGUID + SubTestGUID + Description) • prevents incorrect overrides when multiple SCT subtests share the same GUID • ensures only the intended subtest gets updated based on EDK2 result Signed-off-by: Ashish Sharma ashish.sharma2@arm.com Change-Id: I9ed59e0140e617a93962dbe2512d72c306a4b4b6 --- common/log_parser/bbr/sct/logs_to_json.py | 16 +++++++++++++- .../log_parser/bbr/sct/logs_to_json_edk2.py | 22 ++++++++++++++----- 2 files changed, 31 insertions(+), 7 deletions(-) diff --git a/common/log_parser/bbr/sct/logs_to_json.py b/common/log_parser/bbr/sct/logs_to_json.py index f4d3806b..71c960d5 100644 --- a/common/log_parser/bbr/sct/logs_to_json.py +++ b/common/log_parser/bbr/sct/logs_to_json.py @@ -482,7 +482,8 @@ def main(input_file, output_file): reason_val = item.get("reason", "") if ep_guid and sub_guid: - subtest_dict[(ep_guid.upper(), sub_guid.upper())] = { + desc = item.get("sub_Test_Description", "").strip().upper() + subtest_dict[(ep_guid.upper(), sub_guid.upper(), desc)] = { "result": result_val, "reason": reason_val } @@ -501,10 +502,23 @@ def main(input_file, output_file): for subtest in test_obj["subtests"]: st_guid = subtest["sub_Test_GUID"].upper() +<<<<<<< HEAD (20d715 acs sort keys for merged json and sct changes for json) if (ep_guid_current, st_guid) in subtest_dict: match_record = subtest_dict[(ep_guid_current, st_guid)] subtest["sub_test_result"] = normalize_result(match_record["result"]) subtest["sub_test_result_reason"] = match_record["reason"] +======= + desc_key = subtest["sub_Test_Description"].strip().upper() + lookup_key = (ep_guid_current, st_guid, desc_key) + + if lookup_key in subtest_dict: + match_record = subtest_dict[lookup_key] + result_val = match_record.get("result", "").strip() + reason_val = match_record.get("reason", "").strip() + if result_val: + subtest["sub_test_result"] = normalize_result(result_val) + subtest["reason"] = reason_val +>>>>>>> CHANGE (1260ee Fix duplicate GUID override and add subtest description mapp) # Reorder final dictionary so "test_result" & "reason" appear after "Returned Status Code" for i, test_obj in enumerate(results): diff --git a/common/log_parser/bbr/sct/logs_to_json_edk2.py b/common/log_parser/bbr/sct/logs_to_json_edk2.py index 93dc9fd2..147d578f 100644 --- a/common/log_parser/bbr/sct/logs_to_json_edk2.py +++ b/common/log_parser/bbr/sct/logs_to_json_edk2.py @@ -75,12 +75,10 @@ def parse_edk2_log(input_file): # Check if this row is a header row by looking for our target column names. lower_cols = [col.strip().lower() for col in cols] if not header_found and any(t in lower_cols for t in targets): - col_index_map = {} - for idx, col in enumerate(lower_cols): - if col in targets: - col_index_map[col] = idx + # Capture *all* column names, not just targets + col_index_map = {col: idx for idx, col in enumerate(lower_cols)} header_found = True - continue # Skip processing the header row + continue # If header is found, skip separator rows (rows that contain only dashes) if header_found: @@ -89,11 +87,23 @@ def parse_edk2_log(input_file): # Build a record based on the header column positions. record = { output_key: "" for output_key in targets.values() } + # Extract known columns for key, output_key in targets.items(): idx = col_index_map.get(key) if idx is not None and idx < len(cols): record[output_key] = cols[idx].strip() - # Append the record if at least one target field is non-empty. + + # Capture sub_Test_Description correctly + + # If there's a 'name' column (typical for grouped tables like RuntimeServicesTest, BootServicesTest, etc.) + # then use that column as description. + # Otherwise (like GenericTest), fall back to the first column. + name_idx = col_index_map.get("name") + + if name_idx is not None and name_idx < len(cols): + # Extract from 'name' column + record["sub_Test_Description"] = cols[name_idx].strip() + # Append record if any target field is non-empty if any(record.values()): results.append(record) else: From ea7b17c19d243fd8406c9acd898cd1e34b0c6e8b Mon Sep 17 00:00:00 2001 From: Ashish Sharma Date: Thu, 20 Nov 2025 15:23:24 +0000 Subject: [PATCH 2/2] Fix duplicate GUID override and add subtest description mapping MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit • added extraction of sub_Test_Description from edk2-test-parser logs (first column) • updated SCT logs_to_json to match subtests using (EntryPointGUID + SubTestGUID + Description) • prevents incorrect overrides when multiple SCT subtests share the same GUID • ensures only the intended subtest gets updated based on EDK2 result Signed-off-by: Ashish Sharma ashish.sharma2@arm.com Change-Id: I65284cdf93f8ca8684a7abae5610f8925c5ae48b --- common/log_parser/bbr/sct/logs_to_json.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/common/log_parser/bbr/sct/logs_to_json.py b/common/log_parser/bbr/sct/logs_to_json.py index 71c960d5..d8506e7c 100644 --- a/common/log_parser/bbr/sct/logs_to_json.py +++ b/common/log_parser/bbr/sct/logs_to_json.py @@ -502,12 +502,10 @@ def main(input_file, output_file): for subtest in test_obj["subtests"]: st_guid = subtest["sub_Test_GUID"].upper() -<<<<<<< HEAD (20d715 acs sort keys for merged json and sct changes for json) if (ep_guid_current, st_guid) in subtest_dict: match_record = subtest_dict[(ep_guid_current, st_guid)] subtest["sub_test_result"] = normalize_result(match_record["result"]) subtest["sub_test_result_reason"] = match_record["reason"] -======= desc_key = subtest["sub_Test_Description"].strip().upper() lookup_key = (ep_guid_current, st_guid, desc_key) @@ -518,7 +516,6 @@ def main(input_file, output_file): if result_val: subtest["sub_test_result"] = normalize_result(result_val) subtest["reason"] = reason_val ->>>>>>> CHANGE (1260ee Fix duplicate GUID override and add subtest description mapp) # Reorder final dictionary so "test_result" & "reason" appear after "Returned Status Code" for i, test_obj in enumerate(results):