From ecde60419871820269657a8b88c839a824ecfd73 Mon Sep 17 00:00:00 2001 From: David <49467229+TheSecurityDev@users.noreply.github.com> Date: Sat, 14 Feb 2026 15:21:09 -0600 Subject: [PATCH] ui replay: use openpilot prefix (#37185) * fix: use openpilot prefix * fix ui_state import * comment --- selfdrive/ui/tests/diff/replay.py | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/selfdrive/ui/tests/diff/replay.py b/selfdrive/ui/tests/diff/replay.py index 1efc6dde9..a668cc776 100755 --- a/selfdrive/ui/tests/diff/replay.py +++ b/selfdrive/ui/tests/diff/replay.py @@ -13,9 +13,9 @@ if "RECORD_OUTPUT" not in os.environ: os.environ["RECORD_OUTPUT"] = os.path.join(DIFF_OUT_DIR, os.environ["RECORD_OUTPUT"]) from openpilot.common.params import Params +from openpilot.common.prefix import OpenpilotPrefix from openpilot.system.version import terms_version, training_version from openpilot.system.ui.lib.application import gui_app, MousePos, MouseEvent -from openpilot.selfdrive.ui.ui_state import ui_state FPS = 60 HEADLESS = os.getenv("WINDOWED", "0") == "1" @@ -78,6 +78,9 @@ def handle_event(event: DummyEvent): def run_replay(): + from openpilot.selfdrive.ui.ui_state import ui_state # import here for correct param setup (e.g. training guide) + from openpilot.selfdrive.ui.mici.layouts.main import MiciMainLayout # import here for coverage + setup_state() os.makedirs(DIFF_OUT_DIR, exist_ok=True) @@ -85,7 +88,6 @@ def run_replay(): rl.set_config_flags(rl.FLAG_WINDOW_HIDDEN) gui_app.init_window("ui diff test", fps=FPS) - from openpilot.selfdrive.ui.mici.layouts.main import MiciMainLayout # import here for coverage main_layout = MiciMainLayout() main_layout.set_rect(rl.Rectangle(0, 0, gui_app.width, gui_app.height)) @@ -119,13 +121,14 @@ def run_replay(): def main(): - cov = coverage.coverage(source=['openpilot.selfdrive.ui.mici']) - with cov.collect(): - run_replay() - cov.save() - cov.report() - cov.html_report(directory=os.path.join(DIFF_OUT_DIR, 'htmlcov')) - print("HTML report: htmlcov/index.html") + with OpenpilotPrefix(): + cov = coverage.coverage(source=['openpilot.selfdrive.ui.mici']) + with cov.collect(): + run_replay() + cov.save() + cov.report() + cov.html_report(directory=os.path.join(DIFF_OUT_DIR, 'htmlcov')) + print("HTML report: htmlcov/index.html") if __name__ == "__main__":