From 6738edad1a032de78d58641350bf18f6e95294df Mon Sep 17 00:00:00 2001 From: leomonde Date: Sat, 21 Nov 2026 18:50:22 -0300 Subject: [PATCH] Keep the V60 out of the shared CMA/V40 test fixtures --- opendbc_repo/opendbc/car/volvo/tests/test_cma.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/opendbc_repo/opendbc/car/volvo/tests/test_cma.py b/opendbc_repo/opendbc/car/volvo/tests/test_cma.py index 34452722ca..3563854ff8 100644 --- a/opendbc_repo/opendbc/car/volvo/tests/test_cma.py +++ b/opendbc_repo/opendbc/car/volvo/tests/test_cma.py @@ -16,8 +16,9 @@ CMA = ['VOLVO_XC40_RECHARGE', 'VOLVO_S60_RECHARGE', 'POLESTAR_2'] EXPECTED = {'VOLVO_V40': (2, 1610, 2.647, 14.7, .2), 'VOLVO_XC40_RECHARGE': (0, 2170, 2.702, 15.8, .3), 'VOLVO_S60_RECHARGE': (1, 2020, 2.872, 16.2, .3), - 'POLESTAR_2': (5, 2123, 2.735, 15.8, .3), - 'VOLVO_V60': (8, 1750, 2.776, 15.0, .2)} + 'POLESTAR_2': (5, 2123, 2.735, 15.8, .3)} +# The V60 (EUCD) only shares the params and fingerprint checks; the shared runtime fixtures model CMA/V40 frames +PARAMS = {**EXPECTED, 'VOLVO_V60': (8, 1750, 2.776, 15.0, .2)} def interface(identity, alpha=False, release=False): @@ -64,14 +65,14 @@ def sources(identity, cruise=True, *, frame=0): return checked -@pytest.mark.parametrize('identity', EXPECTED) +@pytest.mark.parametrize('identity', PARAMS) @pytest.mark.parametrize('alpha', [False, True]) @pytest.mark.parametrize('release', [False, True]) def test_all_final_params_and_angle_factory(identity, alpha, release): from openpilot.selfdrive.controls.lib.lateral_controller_factory import create_lateral_controller from openpilot.selfdrive.controls.lib.latcontrol_angle import LatControlAngle cp, ci = interface(identity, alpha, release) - param, mass, wheelbase, ratio, delay = EXPECTED[identity] + param, mass, wheelbase, ratio, delay = PARAMS[identity] assert cp.mass == mass + STD_CARGO_KG # These declared CarParams fields are Float32; compare exact wire values. expected_geometry = struct.unpack('<3f', struct.pack('<3f', wheelbase, ratio, delay)) @@ -85,7 +86,7 @@ def test_all_final_params_and_angle_factory(identity, alpha, release): assert isinstance(create_lateral_controller(cp, ci, .01, mode='stock'), LatControlAngle) -@pytest.mark.parametrize('identity', EXPECTED) +@pytest.mark.parametrize('identity', PARAMS) def test_all_dom_captures_identify_through_real_eliminator(identity): for capture in FINGERPRINTS[CAR(identity)]: cars = all_legacy_fingerprint_cars()