Align CI fixtures with radarless braking and model runtime support

This commit is contained in:
firestar5683
2026-11-10 16:00:19 -06:00
parent 5f9d63494a
commit 960bc90d73
4 changed files with 22 additions and 6 deletions
@@ -373,9 +373,9 @@ class TestHondaCurrentCaller(unittest.TestCase):
if not previous.latActive:
self.assertEqual((tx['torque'], tx['request']), (0, False), row)
else:
if (alpha and address == 0x1DF or pedal and address == 0x200) and tick == 50:
if (alpha and address in (0x1DF, 0x1C8) or pedal and address == 0x200) and tick == 50:
# Card applies the prior Controls envelope. Physical brake has
# already revoked LONG; the native hook must reject this one
# already revoked LONG; the native hook must reject this
# in-flight positive command before the new envelope arrives.
self.assertFalse(accepted, row)
self.assertTrue(previous.longActive, row)
@@ -387,6 +387,8 @@ class TestHondaCurrentCaller(unittest.TestCase):
accel = (data[3] << 3) | (data[4] >> 5)
accel = accel - 0x800 if accel & 0x400 else accel
self.assertEqual((gas, accel), (-30000, 0), row)
if alpha and address == 0x1C8 and tick >= 52 and not reengage:
self.assertEqual(int.from_bytes(data[:2], 'big') >> 4, 0, row)
row['TX'].append(tx)
row['events'] = [str(e.name) for e in driven['onroadEvents'].onroadEvents]
row['fault_reason'] = str(driven['aolAxisState'].aolAxisState.faultReason)
@@ -6,6 +6,7 @@ from pathlib import Path
import tempfile
import threading
import unittest
from unittest.mock import patch
from openpilot.starpilot.galaxy.access import GalaxyAccessOwner
from openpilot.starpilot.galaxy.remote import RemotePairing
@@ -16,6 +17,9 @@ from openpilot.starpilot.models.manager import ModelManager, atomic_json
class LaboratoryHttpTest(unittest.TestCase):
def setUp(self):
unsupported = patch('openpilot.starpilot.models.laboratory.RUNTIME_QUALIFIED', False)
unsupported.start()
self.addCleanup(unsupported.stop)
temporary = tempfile.TemporaryDirectory()
self.addCleanup(temporary.cleanup)
root = Path(temporary.name)
@@ -70,11 +74,13 @@ class LaboratoryHttpTest(unittest.TestCase):
for remote in (False, True):
cookie = self.remote_cookie if remote else self.local_cookie
status, view, _ = self.request('/api/models/laboratory', remote=remote, cookie=cookie)
self.assertEqual(status, 200)
self.assertEqual(status, 200, view)
self.assertEqual({r['value'] for r in view['models']}, {r['id'] for r in self.manifest['models']})
self.assertFalse(view['runtimeSupported'])
self.assertFalse(view['runtime']['active'])
self.assertTrue(any(r['modelLabStatus'] == 'unsupported' and not r['small'] for r in view['models']))
big = [row for row in view['models'] if not row['small']]
self.assertTrue(big)
self.assertTrue(all(row['modelLabEligible'] and row['modelLabChestnut'] for row in big))
views.append(view)
payload = {'enabled': True, 'lateralModel': 'gwm8223', 'longitudinalModel': 'sc23'}
self.assertNotEqual(self.request('/api/models/laboratory', payload=payload, remote=remote, cookie=cookie)[0], 200)
@@ -82,3 +88,11 @@ class LaboratoryHttpTest(unittest.TestCase):
self.assertNotEqual(self.request('/api/models/laboratory', payload=payload, remote=remote, cookie=cookie,
origin='https://untrusted.invalid')[0], 200)
self.assertEqual(views[0], views[1])
def test_runtime_capability_is_separate_from_connected_gpu_and_activation(self):
with patch('openpilot.starpilot.models.laboratory.RUNTIME_QUALIFIED', True):
status, view, _ = self.request('/api/models/laboratory', cookie=self.local_cookie)
self.assertEqual(status, 200, view)
self.assertTrue(view['runtimeSupported'])
self.assertFalse(view['chestnutReady'])
self.assertFalse(view['runtime']['active'])
@@ -25,7 +25,7 @@ def loader(source, *, demo=False, bundled=False, failure=None):
return run
model = SimpleNamespace(warmup=record('warmup'))
namespace = {'demo': demo, 'CP': object(), 'BIG_MODEL_TIMEOUT': 120, 'wait_for_chestnut': record('usb'),
namespace = {'laboratory_request': None, 'demo': demo, 'CP': object(), 'BIG_MODEL_TIMEOUT': 120, 'wait_for_chestnut': record('usb'),
'wait_for_chestnut_power': record('power'), 'set_core_affinity': record('affinity'),
'selection': SimpleNamespace(big_path=None if bundled else Path('/verified.pkl'), big_version='v16',
big_id='mountaindewv3', big_sha256='a' * 64),
+1 -1
View File
@@ -1 +1 @@
{"protected_inventory_sha256": "b5c4808e99cbe09936d17a902d08c523dbc7acd8df9cb5de226b4207d095f661", "schema_version": 1}
{"protected_inventory_sha256": "388ca644c98b0c10d27bf009a39b15a2fd7581a42c82ef5e05cce72fde3c5a83", "schema_version": 1}