diff --git a/.github/workflows/selfdrive_tests.yaml b/.github/workflows/selfdrive_tests.yaml index f28d86228..03dd4f468 100644 --- a/.github/workflows/selfdrive_tests.yaml +++ b/.github/workflows/selfdrive_tests.yaml @@ -244,7 +244,8 @@ jobs: run: eval "$BUILD" - name: Run unit tests run: | - ${{ env.RUN }} "scons -j$(nproc) --test && \ + ${{ env.RUN }} "export SKIP_LONG_TESTS=1 && \ + scons -j$(nproc) --test && \ $UNIT_TEST common && \ $UNIT_TEST opendbc/can && \ $UNIT_TEST selfdrive/boardd && \ diff --git a/selfdrive/car/tests/test_models.py b/selfdrive/car/tests/test_models.py index 9b1660899..bbb797498 100755 --- a/selfdrive/car/tests/test_models.py +++ b/selfdrive/car/tests/test_models.py @@ -43,11 +43,13 @@ for i, c in enumerate(sorted(all_known_cars())): if i % NUM_JOBS == JOB_ID: test_cases.extend((c, r) for r in routes_by_car.get(c, (None, ))) +SKIP_ENV_VAR = "SKIP_LONG_TESTS" + @parameterized_class(('car_model', 'route'), test_cases) class TestCarModel(unittest.TestCase): - @unittest.skipUnless(__name__ == "__main__", "Long running test. Run individually.") + @unittest.skipIf(SKIP_ENV_VAR in os.environ, f"Long running test skipped. Unset {SKIP_ENV_VAR} to run") @classmethod def setUpClass(cls): if cls.route is None: