Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand All @@ -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 }})
Expand Down
2 changes: 1 addition & 1 deletion selfdrive/test/process_replay/migration.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
Expand Down
12 changes: 12 additions & 0 deletions selfdrive/test/process_replay/test_processes_unit.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
14 changes: 13 additions & 1 deletion tools/replay/SConscript
Original file line number Diff line number Diff line change
@@ -1,11 +1,23 @@
import os
import shutil
import subprocess

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']

Expand Down
Loading