mirror of
https://github.com/sunnypilot/sunnypilot.git
synced 2026-02-18 21:14:01 +08:00
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
This commit is contained in:
5
Jenkinsfile
vendored
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)
|
||||
|
||||
Reference in New Issue
Block a user