diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 17b96f0e1bd181..7c1201e35f3538 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -146,6 +146,9 @@ jobs: uv pip install natsort - name: Build openpilot run: scons -j$(nproc) + - name: Build libsafety + working-directory: opendbc_repo + run: scons -j$(nproc) opendbc/safety/tests/libsafety/libsafety.so - name: Validate process replay release contracts run: | pytest -q -n 0 \ @@ -156,8 +159,9 @@ jobs: run: | source selfdrive/test/setup_xvfb.sh # Pre-compile Python bytecode so each pytest worker doesn't need to - $PYTEST --collect-only -m 'not slow' -qq - MAX_EXAMPLES=1 $PYTEST -m 'not slow' + # NAP opendbc does not ship comma's generated honda DBCs; sim tests cannot collect. + $PYTEST --collect-only -m 'not slow' -qq --ignore=tools/sim + MAX_EXAMPLES=1 $PYTEST -m 'not slow' --ignore=tools/sim process_replay: name: process replay (${{ matrix.shard }}) diff --git a/selfdrive/test/process_replay/migration.py b/selfdrive/test/process_replay/migration.py index bc6399aa941db9..b5eba466a34d4a 100644 --- a/selfdrive/test/process_replay/migration.py +++ b/selfdrive/test/process_replay/migration.py @@ -307,7 +307,7 @@ def migrate_pandaStates(msgs): safety_param_migration = { "TOYOTA_PRIUS": EPS_SCALE["TOYOTA_PRIUS"] | ToyotaSafetyFlags.STOCK_LONGITUDINAL, "TOYOTA_RAV4": EPS_SCALE["TOYOTA_RAV4"] | ToyotaSafetyFlags.ALT_BRAKE, - "KIA_EV6": HyundaiSafetyFlags.EV_GAS | HyundaiSafetyFlags.CANFD_LKA_STEER_MSG, + "KIA_EV6": HyundaiSafetyFlags.EV_GAS | HyundaiSafetyFlags.CANFD_LKA_STEERING, "CHEVROLET_VOLT": GMSafetyFlags.EV, "CHEVROLET_BOLT_EUV": GMSafetyFlags.EV | GMSafetyFlags.HW_CAM, } diff --git a/selfdrive/test/process_replay/test_processes_unit.py b/selfdrive/test/process_replay/test_processes_unit.py index a6153ced925887..2443037ec66492 100755 --- a/selfdrive/test/process_replay/test_processes_unit.py +++ b/selfdrive/test/process_replay/test_processes_unit.py @@ -46,6 +46,18 @@ def test_staged_inventory_counts_and_pending_not_executable(): tp.assert_inventory_invariants(cases) +def test_panda_states_migration_uses_opendbc_flag_names(): + # 0.11.1 migration used HyundaiSafetyFlags.CANFD_LKA_STEER_MSG; NAP opendbc + # still names that bit CANFD_LKA_STEERING. Building the map must not crash. + from opendbc.car.hyundai.values import HyundaiSafetyFlags + from openpilot.selfdrive.test.process_replay.migration import migrate_pandaStates + assert hasattr(HyundaiSafetyFlags, "CANFD_LKA_STEERING") + assert not hasattr(HyundaiSafetyFlags, "CANFD_LKA_STEER_MSG") + src = migrate_pandaStates.__code__.co_names + assert "CANFD_LKA_STEER_MSG" not in src + HyundaiSafetyFlags.EV_GAS | HyundaiSafetyFlags.CANFD_LKA_STEERING + + def test_source_segments_compat(): assert len(tp.source_segments) == 17 assert tp.source_segments[0][0] == "HYUNDAI" diff --git a/tools/replay/SConscript b/tools/replay/SConscript index eb7a7322861d8a..4d6ca9671e5f5e 100644 --- a/tools/replay/SConscript +++ b/tools/replay/SConscript @@ -1,3 +1,5 @@ +import os +import shutil import subprocess Import('env', 'arch', 'common', 'messaging', 'visionipc', 'cereal') @@ -5,7 +7,17 @@ Import('env', 'arch', 'common', 'messaging', 'visionipc', 'cereal') replay_env = env.Clone() replay_env['CCFLAGS'] += ['-Wno-deprecated-declarations'] if arch == "Darwin": - openssl_prefix = subprocess.check_output(['brew', '--prefix', 'openssl@3'], encoding='utf8').strip() + openssl_prefix = None + brew = shutil.which("brew") + if brew: + openssl_prefix = subprocess.check_output([brew, '--prefix', 'openssl@3'], encoding='utf8').strip() + else: + for candidate in ("/opt/homebrew/opt/openssl@3", "/usr/local/opt/openssl@3"): + if os.path.isdir(candidate): + openssl_prefix = candidate + break + if not openssl_prefix: + raise FileNotFoundError("openssl@3 not found (brew not on PATH and no keg at /opt/homebrew or /usr/local)") replay_env['CPPPATH'] += [f'{openssl_prefix}/include'] replay_env['LIBPATH'] += [f'{openssl_prefix}/lib']