From 3492e80d19a4395d9481076c916f9ab96a8fb004 Mon Sep 17 00:00:00 2001 From: Justin Newberry Date: Mon, 21 Aug 2023 20:51:27 -0700 Subject: [PATCH] CI: use xdist for car model tests (#29514) * bump panda * try multithreaded for car models * need pytest-cov * upgraded to poetry 1.5.1 and regenerated --- .github/workflows/selfdrive_tests.yaml | 3 +-- poetry.lock | 24 ++++++++++++++++++++---- pyproject.toml | 1 + 3 files changed, 22 insertions(+), 6 deletions(-) diff --git a/.github/workflows/selfdrive_tests.yaml b/.github/workflows/selfdrive_tests.yaml index 2b2341d6ff..991ce74ca9 100644 --- a/.github/workflows/selfdrive_tests.yaml +++ b/.github/workflows/selfdrive_tests.yaml @@ -383,8 +383,7 @@ jobs: - name: Test car models timeout-minutes: 25 run: | - ${{ env.RUN }} "coverage run -m pytest selfdrive/car/tests/test_models.py && \ - coverage xml && \ + ${{ env.RUN }} "pytest --cov --cov-report=xml -n auto --dist=loadscope selfdrive/car/tests/test_models.py && \ chmod -R 777 /tmp/comma_download_cache" env: NUM_JOBS: 5 diff --git a/poetry.lock b/poetry.lock index 16bfe6f375..da50b60ad4 100644 --- a/poetry.lock +++ b/poetry.lock @@ -387,9 +387,7 @@ version = "0.9.14" description = "Python API for communicating with the CARLA server." optional = false python-versions = "*" -files = [ - {file = "carla-0.9.14-cp311-cp311-linux_x86_64.whl", hash = "sha256:f0a8ce0c760d1fef3577e2ef90e9d468e3d85e65bd6d68b44bce51f0d5a0723a"}, -] +files = [] [package.source] type = "url" @@ -3105,6 +3103,24 @@ pluggy = ">=0.12,<2.0" [package.extras] testing = ["argcomplete", "attrs (>=19.2.0)", "hypothesis (>=3.56)", "mock", "nose", "pygments (>=2.7.2)", "requests", "setuptools", "xmlschema"] +[[package]] +name = "pytest-cov" +version = "4.1.0" +description = "Pytest plugin for measuring coverage." +optional = false +python-versions = ">=3.7" +files = [ + {file = "pytest-cov-4.1.0.tar.gz", hash = "sha256:3904b13dfbfec47f003b8e77fd5b589cd11904a21ddf1ab38a64f204d6a10ef6"}, + {file = "pytest_cov-4.1.0-py3-none-any.whl", hash = "sha256:6ba70b9e97e69fcc3fb45bfeab2d0a138fb65c4d0d6a41ef33983ad114be8c3a"}, +] + +[package.dependencies] +coverage = {version = ">=5.2.1", extras = ["toml"]} +pytest = ">=4.6" + +[package.extras] +testing = ["fields", "hunter", "process-tests", "pytest-xdist", "six", "virtualenv"] + [[package]] name = "pytest-xdist" version = "3.3.1" @@ -4161,4 +4177,4 @@ multidict = ">=4.0" [metadata] lock-version = "2.0" python-versions = "~3.11" -content-hash = "4b2510f1465520a9dc757f64861f4fcea9d9663c0ecdebd23b329ef5e0205863" +content-hash = "587fe0b312a1d4a0be2e13fdd4626683227f6c9038d3efacf9866c431d9453b1" diff --git a/pyproject.toml b/pyproject.toml index 0af1bfcfae..0801439945 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -119,6 +119,7 @@ pycurl = "*" pygame = "*" pyprof2calltree = "*" pytest = "*" +pytest-cov = "*" pytest-xdist = "*" scipy = "*" sphinx = "*"