diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 1e6ebe3174c..86918513bbb 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -95,18 +95,17 @@ jobs: run: | export PYTHONPATH=$(grass --config python_path):$PYTHONPATH export LD_LIBRARY_PATH=$(grass --config path)/lib:$LD_LIBRARY_PATH - pytest --verbose --color=yes --durations=0 --durations-min=0.5 \ - --numprocesses auto \ - -ra . \ - -m 'not needs_solo_run' + pytest \ + @.github/workflows/pytest_args_ci.txt \ + @.github/workflows/pytest_args_parallel.txt - name: Run pytest with a single worker (for tests marked with needs_solo_run) shell: micromamba-shell {0} run: | export PYTHONPATH=$(grass --config python_path):$PYTHONPATH export LD_LIBRARY_PATH=$(grass --config path)/lib:$LD_LIBRARY_PATH - pytest --verbose --color=yes --durations=0 --durations-min=0.5 \ - -ra . \ - -m 'needs_solo_run' + pytest \ + @.github/workflows/pytest_args_ci.txt \ + @.github/workflows/pytest_args_not_parallel.txt - name: Cache GRASS Sample Dataset id: cached-data diff --git a/.github/workflows/osgeo4w.yml b/.github/workflows/osgeo4w.yml index d5a68f2741e..15509b87dac 100644 --- a/.github/workflows/osgeo4w.yml +++ b/.github/workflows/osgeo4w.yml @@ -89,7 +89,6 @@ jobs: python3-numpy python3-pip python3-ply - python3-pytest python3-pywin32 python3-six python3-wxpython @@ -120,17 +119,18 @@ jobs: shell: msys2 {0} run: .github/workflows/test_simple.sh - - name: Install pytest plugins - run: python -m pip install pytest-timeout + - name: Install additional python packages + run: | + python -m pip install ^ + pytest ^ + pytest-timeout shell: cmd /D /E:ON /V:OFF /S /C "CALL C:/OSGeo4W/OSGeo4W.bat "{0}"" - name: Run pytest with a single worker run: | call %OSGEO4W_ROOT%\opt\grass\etc\env.bat set PYTHONPATH=%GISBASE%\etc\python;%PYTHONPATH% path %GISBASE%\lib;%GISBASE%\bin;%PATH% - pytest --verbose --color=yes ^ - --durations=0 --durations-min=0.5 ^ - -ra . + pytest @.github/workflows/pytest_args_ci.txt shell: cmd /D /E:ON /V:OFF /S /C "CALL C:/OSGeo4W/OSGeo4W.bat "{0}"" - name: Run tests diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 49a3ebfab0d..aa16abf6322 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -87,12 +87,10 @@ jobs: export LD_LIBRARY_PATH=$(grass --config path)/lib:$LD_LIBRARY_PATH export INITIAL_GISBASE="$(grass --config path)" export INITIAL_PWD="${PWD}" - pytest --verbose --color=yes --durations=0 --durations-min=0.5 \ - --numprocesses auto \ - --cov \ - --cov-context=test \ - -ra . \ - -m 'not needs_solo_run' + pytest \ + @.github/workflows/pytest_args_ci.txt \ + @.github/workflows/pytest_args_cov.txt \ + @.github/workflows/pytest_args_parallel.txt - name: Run pytest with a single worker (for tests marked with needs_solo_run) run: | @@ -100,12 +98,10 @@ jobs: export LD_LIBRARY_PATH=$(grass --config path)/lib:$LD_LIBRARY_PATH export INITIAL_GISBASE="$(grass --config path)" export INITIAL_PWD="${PWD}" - pytest --verbose --color=yes --durations=0 --durations-min=0.5 \ - --cov \ - --cov-context=test \ - --cov-append \ - -ra . \ - -m 'needs_solo_run' + pytest \ + @.github/workflows/pytest_args_ci.txt \ + @.github/workflows/pytest_args_cov.txt \ + @.github/workflows/pytest_args_not_parallel.txt - name: Fix non-standard installed script paths in coverage data run: | export PYTHONPATH=`grass --config python_path`:$PYTHONPATH diff --git a/.github/workflows/pytest_args_ci.txt b/.github/workflows/pytest_args_ci.txt new file mode 100644 index 00000000000..c661b4896b6 --- /dev/null +++ b/.github/workflows/pytest_args_ci.txt @@ -0,0 +1,5 @@ +--verbose +--color=yes +--durations=0 +--durations-min=0.5 +-ra diff --git a/.github/workflows/pytest_args_cov.txt b/.github/workflows/pytest_args_cov.txt new file mode 100644 index 00000000000..5225d9f2602 --- /dev/null +++ b/.github/workflows/pytest_args_cov.txt @@ -0,0 +1,3 @@ +--cov +--cov-context=test +--cov-append diff --git a/.github/workflows/pytest_args_not_parallel.txt b/.github/workflows/pytest_args_not_parallel.txt new file mode 100644 index 00000000000..e2c41218d07 --- /dev/null +++ b/.github/workflows/pytest_args_not_parallel.txt @@ -0,0 +1 @@ +-m needs_solo_run diff --git a/.github/workflows/pytest_args_parallel.txt b/.github/workflows/pytest_args_parallel.txt new file mode 100644 index 00000000000..c32742f5162 --- /dev/null +++ b/.github/workflows/pytest_args_parallel.txt @@ -0,0 +1,2 @@ +--numprocesses=auto +-m not needs_solo_run