From 65374934509fc5be457e04626359b52632ba7078 Mon Sep 17 00:00:00 2001 From: Justin Newberry Date: Thu, 31 Aug 2023 17:17:07 -0700 Subject: [PATCH] Tests: disable laika tests in CI (#29742) skip laika old-commit-hash: 4c039ab02230c7fcf2439b56fe04ad79df911ad4 --- selfdrive/car/tests/test_models.py | 3 +-- selfdrive/locationd/test/test_laikad.py | 3 +++ selfdrive/test/helpers.py | 1 + 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/selfdrive/car/tests/test_models.py b/selfdrive/car/tests/test_models.py index 57b7037530..d2198dc27b 100755 --- a/selfdrive/car/tests/test_models.py +++ b/selfdrive/car/tests/test_models.py @@ -21,6 +21,7 @@ from openpilot.tools.lib.logreader import LogReader from openpilot.tools.lib.route import Route, SegmentName, RouteName from panda.tests.libpanda import libpanda_py +from openpilot.selfdrive.test.helpers import SKIP_ENV_VAR PandaType = log.PandaState.PandaType @@ -62,8 +63,6 @@ def get_test_cases() -> List[Tuple[str, Optional[CarTestRoute]]]: return test_cases -SKIP_ENV_VAR = "SKIP_LONG_TESTS" - class TestCarModelBase(unittest.TestCase): car_model: Optional[str] = None diff --git a/selfdrive/locationd/test/test_laikad.py b/selfdrive/locationd/test/test_laikad.py index a8d69502cf..2c4a8a406d 100755 --- a/selfdrive/locationd/test/test_laikad.py +++ b/selfdrive/locationd/test/test_laikad.py @@ -1,4 +1,5 @@ #!/usr/bin/env python3 +import os import time import unittest from cereal import log @@ -18,6 +19,7 @@ from openpilot.selfdrive.test.openpilotci import get_url from openpilot.tools.lib.logreader import LogReader from openpilot.selfdrive.test.process_replay.process_replay import get_process_config, replay_process +from openpilot.selfdrive.test.helpers import SKIP_ENV_VAR GPS_TIME_PREDICTION_ORBITS_RUSSIAN_SRC = GPSTime.from_datetime(datetime(2022, month=1, day=29, hour=12)) UBLOX_TEST_ROUTE = "4cf7a6ad03080c90|2021-09-29--13-46-36" @@ -92,6 +94,7 @@ def get_measurement_mock(gpstime, sat_ephemeris): return meas +@unittest.skipIf(SKIP_ENV_VAR in os.environ, f"Laika test skipped since it's long and not currently used. Unset {SKIP_ENV_VAR} to run") class TestLaikad(unittest.TestCase): @classmethod diff --git a/selfdrive/test/helpers.py b/selfdrive/test/helpers.py index e376a86706..1fbf2c4d20 100644 --- a/selfdrive/test/helpers.py +++ b/selfdrive/test/helpers.py @@ -12,6 +12,7 @@ from openpilot.selfdrive.manager.process_config import managed_processes from openpilot.system.hardware import PC from openpilot.system.version import training_version, terms_version +SKIP_ENV_VAR = "SKIP_LONG_TESTS" def set_params_enabled(): os.environ['PASSIVE'] = "0"