test models: skip with flag

old-commit-hash: a55e25d9d2
taco
Adeeb Shihadeh 3 years ago
parent 426a300c21
commit 3679d88b80
  1. 3
      .github/workflows/selfdrive_tests.yaml
  2. 4
      selfdrive/car/tests/test_models.py

@ -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 && \

@ -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:

Loading…
Cancel
Save