mirror of
https://github.com/MoreTore/openpilot.git
synced 2026-09-29 19:04:03 +08:00
77d6d1a8f1
* get platform_str from the enum name * fix tests * add migration table * remove impossible todo * Add link to PR in MIGRATION table Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com> * Remove useless brand name comments and rename RAM_1500 to RAM_1500_5TH_GEN * rename RAM_HD to RAM_HD_5TH_GEN * rename references to RAM_HD and RAM_1500 * change "mock" to "MOCK" and rename torque data of Nissan Leaf 2018 IC * remove MOCK from fingerprints.py * change hard-coded car model in test_can_fingerprint.py/test_timing * migration * update ref * space * prius --------- Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com> Co-authored-by: justin newberry <justin@comma.ai> Co-authored-by: Justin Newberry <jnewberry0502@gmail.com> old-commit-hash: 489528dcae3888311f92075ba9e0f68626725121
46 lines
1.7 KiB
Python
Executable File
46 lines
1.7 KiB
Python
Executable File
#!/usr/bin/env python3
|
|
|
|
import unittest
|
|
|
|
from parameterized import parameterized
|
|
|
|
from openpilot.selfdrive.test.process_replay.regen import regen_segment, DummyFrameReader
|
|
from openpilot.selfdrive.test.process_replay.process_replay import check_openpilot_enabled
|
|
from openpilot.tools.lib.openpilotci import get_url
|
|
from openpilot.tools.lib.logreader import LogReader
|
|
from openpilot.tools.lib.framereader import FrameReader
|
|
|
|
TESTED_SEGMENTS = [
|
|
("PRIUS_C2", "0982d79ebb0de295|2021-01-04--17-13-21--13"), # TOYOTA.PRIUS: NEO, pandaStateDEPRECATED, no peripheralState, sensorEventsDEPRECATED
|
|
# Enable these once regen on CI becomes faster or use them for different tests running controlsd in isolation
|
|
# ("MAZDA_C3", "bd6a637565e91581|2021-10-30--15-14-53--4"), # MAZDA.CX9_2021: TICI, incomplete managerState
|
|
# ("FORD_C3", "54827bf84c38b14f|2023-01-26--21-59-07--4"), # FORD.BRONCO_SPORT_MK1: TICI
|
|
]
|
|
|
|
|
|
def ci_setup_data_readers(route, sidx):
|
|
lr = LogReader(get_url(route, sidx, "rlog"))
|
|
frs = {
|
|
'roadCameraState': FrameReader(get_url(route, sidx, "fcamera")),
|
|
'driverCameraState': DummyFrameReader.zero_dcamera()
|
|
}
|
|
if next((True for m in lr if m.which() == "wideRoadCameraState"), False):
|
|
frs["wideRoadCameraState"] = FrameReader(get_url(route, sidx, "ecamera"))
|
|
|
|
return lr, frs
|
|
|
|
|
|
class TestRegen(unittest.TestCase):
|
|
@parameterized.expand(TESTED_SEGMENTS)
|
|
def test_engaged(self, case_name, segment):
|
|
route, sidx = segment.rsplit("--", 1)
|
|
lr, frs = ci_setup_data_readers(route, sidx)
|
|
output_logs = regen_segment(lr, frs, disable_tqdm=True)
|
|
|
|
engaged = check_openpilot_enabled(output_logs)
|
|
self.assertTrue(engaged, f"openpilot not engaged in {case_name}")
|
|
|
|
|
|
if __name__=='__main__':
|
|
unittest.main()
|