diff --git a/opendbc/car/tests/car_diff.py b/opendbc/car/tests/car_diff.py index b4424be8975..6bfe4914a78 100755 --- a/opendbc/car/tests/car_diff.py +++ b/opendbc/car/tests/car_diff.py @@ -293,8 +293,16 @@ def main(platform: str | None = None, segments_per_platform: int = 10, update_re icon = "⚠️" if with_diffs else "✅" print(f"\n{icon} {len(with_diffs)} changed, {n_passed} passed, {len(errors)} errors") - for plat, seg, err in errors: - print(f"\nERROR {plat} - {seg}: {err}") + if errors: + # Group identical errors so a single bug doesn't spam the report with one traceback per segment + by_err: dict[str, list[str]] = defaultdict(list) + for plat, seg, err in errors: + by_err[err].append(f"{plat} - {seg}") + print("
Show errors\n\n```") + for err, segs in sorted(by_err.items(), key=lambda kv: -len(kv[1])): + affected = ", ".join(segs[:3]) + (f" (+{len(segs) - 3} more)" if len(segs) > 3 else "") + print(f"\nERROR ({len(segs)}x) {affected}:\n{err.rstrip()}") + print("```\n
") if with_diffs: print("
Show changes\n\n```")