test models: skip with flag

This commit is contained in:
Adeeb Shihadeh 2022-03-23 16:42:04 -07:00
parent 85d8997a8a
commit a55e25d9d2
2 changed files with 5 additions and 2 deletions

View File

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

View File

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