From a9ca67dbca20e428dc27ce213a6c4dade85cf38e Mon Sep 17 00:00:00 2001 From: Julius Busecke Date: Thu, 8 Jul 2021 17:16:17 -0400 Subject: [PATCH] Move parallel test execution from pyproj.toml to gh actions (#159) * Move parallel test execution from pyproj.toml to gh actions The way this was set up, causes issues when pytest-xdist is not installed. Ill move that command to the CI only, so the user can just run the test using `pytest`. Found by @TomNicholas * Update ci.yaml --- .github/workflows/ci.yaml | 6 +++--- pyproject.toml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 4e5290cc..1b99e272 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -72,7 +72,7 @@ jobs: run: lscpu - name: Run Tests run: | - pytest --cov=./ --cov-report=xml --ignore=tests/test_preprocessing_cloud.py + pytest -n auto --cov=./ --cov-report=xml --ignore=tests/test_preprocessing_cloud.py - name: Upload code coverage to Codecov uses: codecov/codecov-action@v1 with: @@ -118,7 +118,7 @@ jobs: run: conda list - name: Run Tests run: | - pytest --ignore=tests/test_preprocessing_cloud.py + pytest -n auto --ignore=tests/test_preprocessing_cloud.py cloud-tests: needs: detect-ci-trigger @@ -168,4 +168,4 @@ jobs: run: | pwd echo $PYTHONPATH - pytest --reruns 1 --reruns-delay 5 tests/test_preprocessing_cloud.py --gl ${{ matrix.grid_label }} --ei ${{ matrix.experiment_id }} --vi ${{ matrix.variable_id }} + pytest -n auto --reruns 1 --reruns-delay 5 tests/test_preprocessing_cloud.py --gl ${{ matrix.grid_label }} --ei ${{ matrix.experiment_id }} --vi ${{ matrix.variable_id }} diff --git a/pyproject.toml b/pyproject.toml index 58ee8369..c3e54eaf 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -24,7 +24,7 @@ known_third_party = ["cftime", "dask", "fsspec", "numpy", "pandas", "pkg_resourc [tool.pytest.ini_options] minversion = "6.0" -addopts = " -vv -rXfE -n auto" +addopts = " -vv -rXfE" # only test the root level, otherwise it picks up the tests of the project template testpaths = [ "tests",