From c807252cc849e10286e3f50a1799954dde451b90 Mon Sep 17 00:00:00 2001 From: elkoled Date: Fri, 29 May 2026 16:17:54 -0700 Subject: [PATCH] TEST: car_diff error dropdown (intentional nissan failure) Not for merge. Adds the car_diff error dropdown and a deliberate raise in nissan so the replay errors, to verify the PR comment renders the error dropdown. --- opendbc/car/nissan/carcontroller.py | 1 + opendbc/car/tests/car_diff.py | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/opendbc/car/nissan/carcontroller.py b/opendbc/car/nissan/carcontroller.py index 42f693a2b16..ad0717267c6 100644 --- a/opendbc/car/nissan/carcontroller.py +++ b/opendbc/car/nissan/carcontroller.py @@ -22,6 +22,7 @@ def __init__(self, dbc_names, CP): self.packer = CANPacker(dbc_names[Bus.pt]) def update(self, CC, CS, now_nanos): + raise RuntimeError("car_diff error dropdown test") # TODO: remove, intentional failure to exercise car_diff error reporting actuators = CC.actuators hud_control = CC.hudControl pcm_cancel_cmd = CC.cruiseControl.cancel diff --git a/opendbc/car/tests/car_diff.py b/opendbc/car/tests/car_diff.py index b4424be8975..37d82314056 100755 --- a/opendbc/car/tests/car_diff.py +++ b/opendbc/car/tests/car_diff.py @@ -293,8 +293,11 @@ 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: + print("
Show errors\n\n```") + for err in dict.fromkeys(err for _, _, err in errors): + print(f"\n{err}") + print("```\n
") if with_diffs: print("
Show changes\n\n```")