Pytest: reenable gc in pytest fixture + re-combine jenkins car tests (#31351)

* Revert "jenkins: spilt car tests in two steps (#31346)"

This reverts commit 8a00b30029.

* enable gc

* codespell

* useless comment
pull/31352/head
Justin Newberry 1 year ago committed by GitHub
parent 8f5dcb3019
commit 6933d0560a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 5
      Jenkinsfile
  2. 6
      conftest.py

5
Jenkinsfile vendored

@ -272,9 +272,8 @@ node {
'car tests': {
pcStage("car tests") {
sh label: "build", script: "selfdrive/manager/build.py"
sh label: "test_models", script: "INTERNAL_SEG_CNT=300 FILEREADER_CACHE=1 INTERNAL_SEG_LIST=selfdrive/car/tests/test_models_segs.txt \
pytest selfdrive/car/tests/test_models.py"
sh label: "test_car_interfaces", script: "MAX_EXAMPLES=300 pytest selfdrive/car/tests/test_car_interfaces.py"
sh label: "run car tests", script: "cd selfdrive/car/tests && MAX_EXAMPLES=300 INTERNAL_SEG_CNT=300 FILEREADER_CACHE=1 \
INTERNAL_SEG_LIST=selfdrive/car/tests/test_models_segs.txt pytest test_models.py test_car_interfaces.py"
}
},

@ -1,3 +1,4 @@
import gc
import os
import pytest
import random
@ -45,6 +46,11 @@ def openpilot_function_fixture(request):
# cleanup any started processes
manager.manager_cleanup()
# some processes disable gc for performance, re-enable here
if not gc.isenabled():
gc.enable()
gc.collect()
# If you use setUpClass, the environment variables won't be cleared properly,
# so we need to hook both the function and class pytest fixtures
@pytest.fixture(scope="class", autouse=True)

Loading…
Cancel
Save