From 7bd57d57a5cf045536c9eedc3805c0359f18ed2e Mon Sep 17 00:00:00 2001 From: Dongdong Tian Date: Thu, 23 May 2024 06:39:31 +0800 Subject: [PATCH] CI: Remove pytest-xdist and pytest-rerunfailures options from addopts and only add them in CI jobs (#3267) --- .github/workflows/benchmarks.yml | 6 +++--- .github/workflows/ci_tests.yaml | 2 +- .github/workflows/ci_tests_dev.yaml | 2 +- environment.yml | 2 -- pyproject.toml | 2 +- 5 files changed, 6 insertions(+), 8 deletions(-) diff --git a/.github/workflows/benchmarks.yml b/.github/workflows/benchmarks.yml index 5e09986f3ff..06a2fa8b731 100644 --- a/.github/workflows/benchmarks.yml +++ b/.github/workflows/benchmarks.yml @@ -69,9 +69,9 @@ jobs: pytest pytest-codspeed pytest-mpl - pytest-rerunfailures + pytest-rerunfailures pytest-xdist - + # Download cached remote files (artifacts) from GitHub - name: Download remote data from GitHub run: | @@ -93,4 +93,4 @@ jobs: with: # 'bash -el -c' is needed to use the custom shell. # See https://github.com/CodSpeedHQ/action/issues/65. - run: bash -el -c "python -c \"import pygmt; pygmt.show_versions()\"; PYGMT_USE_EXTERNAL_DISPLAY=false python -m pytest -r P --pyargs pygmt --codspeed" + run: bash -el -c "python -c \"import pygmt; pygmt.show_versions()\"; PYGMT_USE_EXTERNAL_DISPLAY=false python -m pytest -r P -n auto --reruns 2 --pyargs pygmt --codspeed" diff --git a/.github/workflows/ci_tests.yaml b/.github/workflows/ci_tests.yaml index b24173ed92e..ce55888c7d8 100644 --- a/.github/workflows/ci_tests.yaml +++ b/.github/workflows/ci_tests.yaml @@ -157,7 +157,7 @@ jobs: # Run the regular tests - name: Run tests - run: make test PYTEST_EXTRA="-r P" + run: make test PYTEST_EXTRA="-r P -n auto --reruns 2" # Upload diff images on test failure - name: Upload diff images if any test fails diff --git a/.github/workflows/ci_tests_dev.yaml b/.github/workflows/ci_tests_dev.yaml index 08707583abb..1e783752dea 100644 --- a/.github/workflows/ci_tests_dev.yaml +++ b/.github/workflows/ci_tests_dev.yaml @@ -173,7 +173,7 @@ jobs: # Run the tests - name: Test with pytest - run: make test PYTEST_EXTRA="-r P" + run: make test PYTEST_EXTRA="-r P -n auto --reruns 2" env: GMT_LIBRARY_PATH: ${{ runner.temp }}/gmt-install-dir/lib diff --git a/environment.yml b/environment.yml index ad92914bda9..88342d2c64f 100644 --- a/environment.yml +++ b/environment.yml @@ -32,8 +32,6 @@ dependencies: - pytest-cov - pytest-doctestplus - pytest-mpl - - pytest-rerunfailures - - pytest-xdist # Dev dependencies (building documentation) - myst-parser - panel diff --git a/pyproject.toml b/pyproject.toml index aa09cd11e92..773bf07f5e6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -162,7 +162,7 @@ max-args=10 [tool.pytest.ini_options] minversion = "6.0" -addopts = "--verbose --durations=0 --durations-min=0.2 --doctest-modules --mpl --mpl-results-path=results -n auto --reruns 2" +addopts = "--verbose --durations=0 --durations-min=0.2 --doctest-modules --mpl --mpl-results-path=results" markers = [ "benchmark: mark a test with custom benchmark settings.", ]