Skip to content

Commit

Permalink
ci: fix ui report issues (commaai#33585)
Browse files Browse the repository at this point in the history
* fix ui report issues

* fix indentation

* Update selfdrive/ui/tests/test_ui/run.py

---------

Co-authored-by: Shane Smiskol <[email protected]>
  • Loading branch information
deanlee and sshane authored Sep 19, 2024
1 parent 08b731c commit fc8762a
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions selfdrive/ui/tests/test_ui/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

from cereal import log
from msgq.visionipc import VisionIpcServer, VisionStreamType
from cereal.messaging import PubMaster, log_from_bytes
from cereal.messaging import PubMaster, log_from_bytes, sub_sock
from openpilot.common.basedir import BASEDIR
from openpilot.common.params import Params
from openpilot.common.prefix import OpenpilotPrefix
Expand Down Expand Up @@ -51,7 +51,15 @@ def setup_onroad(click, pm: PubMaster):
vipc_server.create_buffers(stream_type, 5, False, cam.width, cam.height)
vipc_server.start_listener()

for packet_id in range(30):
uidebug_received_cnt = 0
packet_id = 0
uidebug_sock = sub_sock('uiDebug')

# Condition check for uiDebug processing
check_uidebug = DATA['deviceState'].deviceState.started and not DATA['carParams'].carParams.notCar

# Loop until 20 'uiDebug' messages are received
while uidebug_received_cnt <= 20:
for service, data in DATA.items():
if data:
data.clear_write_flag()
Expand All @@ -60,6 +68,13 @@ def setup_onroad(click, pm: PubMaster):
for stream_type, _, image in STREAMS:
vipc_server.send(stream_type, image, packet_id, packet_id, packet_id)

if check_uidebug:
while uidebug_sock.receive(non_blocking=True):
uidebug_received_cnt += 1
else:
uidebug_received_cnt += 1

packet_id += 1
time.sleep(0.05)

def setup_onroad_wide(click, pm: PubMaster):
Expand All @@ -70,10 +85,12 @@ def setup_onroad_wide(click, pm: PubMaster):
def setup_onroad_sidebar(click, pm: PubMaster):
setup_onroad(click, pm)
click(500, 500)
setup_onroad(click, pm)

def setup_onroad_wide_sidebar(click, pm: PubMaster):
setup_onroad_wide(click, pm)
click(500, 500)
setup_onroad_wide(click, pm)

def setup_body(click, pm: PubMaster):
DATA['carParams'].carParams.carName = "BODY"
Expand Down

0 comments on commit fc8762a

Please sign in to comment.