Skip to content

Commit

Permalink
fix: bad device comp parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
tomli380576 committed Oct 6, 2024
1 parent 2205b9c commit 5c64358
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions Tools/PC/c3-submission-helpers/better-cbwb-diffs.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,10 @@ def get_device_cmp_lines(file: io.TextIOWrapper) -> list[str]:
if line.startswith("## Checking system services..."):
break
if should_include:
cmp_lines.append(line.strip())
clean_line = line.strip()
ignore = ("", "Device match during reboot cycle")
if clean_line not in ignore:
cmp_lines.append(clean_line)
return cmp_lines


Expand Down Expand Up @@ -152,8 +155,7 @@ def group_device_cmp_output(file: io.TextIOWrapper) -> dict[str, list[str]]:
for a, b in itertools.groupby(
reversed(get_device_cmp_lines(file)),
key=lambda line: line.endswith(
"is different from the original list"
"gathered at the beginning of the session!"
"is different from the original list gathered at the beginning of the session!"
),
)
]
Expand Down Expand Up @@ -218,7 +220,7 @@ def short_print(
for fail_type, results in boot_results.items():
failed_runs = sorted(list(results.keys()))
print(
f"{getattr(C, fail_type.lower())}{fail_type} failures:{C.end} {failed_runs}"
f"{getattr(C, fail_type.lower(), C.medium)}{fail_type} failures:{C.end} {failed_runs}"
)
if expected_n_runs != 0:
print(
Expand Down Expand Up @@ -274,6 +276,8 @@ def main():
for message in messages:
fwts_results[fail_type][run_index].append(message)

f.seek(0) # rewind file pointer

grouped_device_cmp_output = group_device_cmp_output(f)
for fail_type, messages in grouped_device_cmp_output.items():
for message in messages:
Expand Down

0 comments on commit 5c64358

Please sign in to comment.