mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-08-21 16:23:46 +08:00
Pytest: tici mark for skipping on-device tests (#30412)
* mark tici * not those ones * missed that one * add those * add pypoetry * oops old-commit-hash: aec7cea30d48dc8915eea38c86de7d4effa0548d
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
#!/usr/bin/env python3
|
||||
import os
|
||||
import pytest
|
||||
import time
|
||||
import unittest
|
||||
|
||||
@@ -8,17 +9,16 @@ from cereal import log
|
||||
from openpilot.common.gpio import gpio_set, gpio_init
|
||||
from panda import Panda, PandaDFU, PandaProtocolMismatch
|
||||
from openpilot.selfdrive.manager.process_config import managed_processes
|
||||
from openpilot.system.hardware import HARDWARE, PC
|
||||
from openpilot.system.hardware import HARDWARE
|
||||
from openpilot.system.hardware.tici.pins import GPIO
|
||||
|
||||
HERE = os.path.dirname(os.path.realpath(__file__))
|
||||
|
||||
|
||||
@pytest.mark.tici
|
||||
class TestPandad(unittest.TestCase):
|
||||
|
||||
def setUp(self):
|
||||
if PC:
|
||||
raise unittest.SkipTest("needs a panda")
|
||||
# ensure panda is up
|
||||
if len(Panda.list()) == 0:
|
||||
self._run_test(60)
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#!/usr/bin/env python3
|
||||
import os
|
||||
import pytest
|
||||
import signal
|
||||
import time
|
||||
import unittest
|
||||
@@ -17,6 +18,7 @@ MAX_STARTUP_TIME = 3
|
||||
BLACKLIST_PROCS = ['manage_athenad', 'pandad', 'pigeond']
|
||||
|
||||
|
||||
@pytest.mark.tici
|
||||
class TestManager(unittest.TestCase):
|
||||
def setUp(self):
|
||||
os.environ['PASSIVE'] = '0'
|
||||
|
||||
@@ -13,6 +13,7 @@ from openpilot.selfdrive.test.process_replay.vision_meta import meta_from_camera
|
||||
IMG = np.zeros(int(tici_f_frame_size[0]*tici_f_frame_size[1]*(3/2)), dtype=np.uint8)
|
||||
IMG_BYTES = IMG.flatten().tobytes()
|
||||
|
||||
|
||||
class TestModeld(unittest.TestCase):
|
||||
|
||||
def setUp(self):
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#!/usr/bin/env python3
|
||||
import numpy as np
|
||||
import os
|
||||
import pytest
|
||||
import unittest
|
||||
import requests
|
||||
import threading
|
||||
@@ -10,7 +11,6 @@ import cereal.messaging as messaging
|
||||
from typing import Any
|
||||
from cereal.visionipc import VisionIpcClient, VisionStreamType
|
||||
from openpilot.selfdrive.manager.process_config import managed_processes
|
||||
from openpilot.system.hardware import TICI
|
||||
|
||||
LLK_DECIMATION = 10
|
||||
CACHE_PATH = "/data/mbgl-cache-navd.db"
|
||||
@@ -189,10 +189,8 @@ class TestMapRenderer(unittest.TestCase):
|
||||
|
||||
self._run_test(True, LOCATION2_REPEATED)
|
||||
|
||||
@pytest.mark.tici
|
||||
def test_render_time_distribution(self):
|
||||
if not TICI:
|
||||
raise unittest.SkipTest
|
||||
|
||||
self._setup_test()
|
||||
# from location1 -> location2 and back
|
||||
locations = np.array([*np.linspace(LOCATION1, LOCATION2, 2000), *np.linspace(LOCATION2, LOCATION1, 2000)]).tolist()
|
||||
|
||||
@@ -5,6 +5,7 @@ import json
|
||||
import os
|
||||
import pathlib
|
||||
import psutil
|
||||
import pytest
|
||||
import shutil
|
||||
import subprocess
|
||||
import time
|
||||
@@ -98,6 +99,7 @@ def cputime_total(ct):
|
||||
return ct.cpuUser + ct.cpuSystem + ct.cpuChildrenUser + ct.cpuChildrenSystem
|
||||
|
||||
|
||||
@pytest.mark.tici
|
||||
class TestOnroad(unittest.TestCase):
|
||||
|
||||
@classmethod
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#!/usr/bin/env python3
|
||||
import os
|
||||
import pytest
|
||||
import time
|
||||
import subprocess
|
||||
|
||||
@@ -9,6 +10,7 @@ from openpilot.common.timeout import Timeout
|
||||
from openpilot.selfdrive.test.helpers import set_params_enabled
|
||||
|
||||
|
||||
@pytest.mark.tici
|
||||
def test_time_to_onroad():
|
||||
# launch
|
||||
set_params_enabled()
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#!/usr/bin/env python3
|
||||
import datetime
|
||||
import os
|
||||
import pytest
|
||||
import time
|
||||
import tempfile
|
||||
import unittest
|
||||
@@ -13,6 +14,7 @@ from openpilot.common.basedir import BASEDIR
|
||||
from openpilot.common.params import Params
|
||||
|
||||
|
||||
@pytest.mark.tici
|
||||
class TestUpdated(unittest.TestCase):
|
||||
|
||||
def setUp(self):
|
||||
|
||||
Reference in New Issue
Block a user