diff --git a/Jenkinsfile b/Jenkinsfile index 09684a3198..56e933c62a 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -234,8 +234,8 @@ node { 'car tests': { pcStage("car tests") { sh label: "build", script: "selfdrive/manager/build.py" - sh label: "test_models.py", script: "FILEREADER_CACHE=1 RANDOM_SEED=$RANDOM INTERNAL_SEG_CNT=250 \ - INTERNAL_SEG_LIST=selfdrive/car/tests/test_models_segs.txt pytest selfdrive/car/tests/test_models.py" + sh label: "test_models.py", script: "INTERNAL_SEG_CNT=250 INTERNAL_SEG_LIST=selfdrive/car/tests/test_models_segs.txt FILEREADER_CACHE=1 \ + pytest selfdrive/car/tests/test_models.py" sh label: "test_car_interfaces.py", script: "MAX_EXAMPLES=100 pytest selfdrive/car/tests/test_car_interfaces.py" } }, diff --git a/pyproject.toml b/pyproject.toml index ffbd5d43b7..bc60b81a36 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -152,6 +152,7 @@ pytest-xdist = "*" pytest-timeout = "*" pytest-timeouts = "*" pytest-random-order = "*" +pytest-randomly = "*" ruff = "*" scipy = "*" sphinx = "*" diff --git a/selfdrive/car/tests/test_models.py b/selfdrive/car/tests/test_models.py index 2672808f29..966c4b1477 100755 --- a/selfdrive/car/tests/test_models.py +++ b/selfdrive/car/tests/test_models.py @@ -32,7 +32,6 @@ NUM_JOBS = int(os.environ.get("NUM_JOBS", "1")) JOB_ID = int(os.environ.get("JOB_ID", "0")) INTERNAL_SEG_LIST = os.environ.get("INTERNAL_SEG_LIST", "") INTERNAL_SEG_CNT = int(os.environ.get("INTERNAL_SEG_CNT", "0")) -RANDOM_SEED = int(os.environ.get("RANDOM_SEED", "0")) def get_test_cases() -> List[Tuple[str, Optional[CarTestRoute]]]: @@ -51,9 +50,6 @@ def get_test_cases() -> List[Tuple[str, Optional[CarTestRoute]]]: with open(os.path.join(BASEDIR, INTERNAL_SEG_LIST), "r") as f: seg_list = f.read().splitlines() - if RANDOM_SEED: - random.seed(RANDOM_SEED) - seg_list_grouped = [(platform[2:], segment) for platform, segment in zip(seg_list[::2], seg_list[1::2])] seg_list_grouped = random.sample(seg_list_grouped, INTERNAL_SEG_CNT or len(seg_list_grouped)) for platform, segment in seg_list_grouped: