Skip to content

Commit 94efa1f

Browse files
committed
Migrate tests to be based on 'uv-pytest-coverage' - closes #1424
1 parent 9686bf0 commit 94efa1f

5 files changed

Lines changed: 18 additions & 62 deletions

File tree

‎.github/workflows/dockerised-postgres.yml‎

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -56,15 +56,9 @@ jobs:
5656
with:
5757
python-version: ${{ matrix.python-version }}
5858
- name: Run test noproc fixture on docker
59-
id: run_docker_tests
60-
uses: fizyk/actions-reuse/.github/actions/uv-run@42b61e053c1d70a61deb42b323c1a2229e2e7fe0 # v5.5.0
61-
with:
62-
command: python -m coverage run --data-file=.coverage.docker -m pytest -n 0 --max-worker-restart 0 -k docker --postgresql-host=localhost --postgresql-port 5433 --postgresql-password=postgres
63-
env: '{"COVERAGE_PROCESS_START": ".coveragerc", "COVERAGE_FILE": ".coverage.docker"}'
64-
- name: Combine and export docker coverage
65-
if: ${{ always() && (steps.run_docker_tests.conclusion == 'success' || steps.run_docker_tests.conclusion == 'failure') }}
66-
uses: fizyk/actions-reuse/.github/actions/coverage-combine-export-uv@42b61e053c1d70a61deb42b323c1a2229e2e7fe0 # v5.5.0
59+
uses: fizyk/actions-reuse/.github/actions/uv-pytest-coverage@7eefbd6ffc6c6787ad3be6ce93dcf475e3ae99b5 # v5.6.0
6760
with:
61+
pytest-opts: -n 0 --max-worker-restart 0 -k docker --postgresql-host=localhost --postgresql-port 5433 --postgresql-password=postgres
6862
data-file: .coverage.docker
6963
output-file: coverage-docker.xml
7064
- name: Upload coverage to Codecov

‎.github/workflows/oldest-postgres.yml‎

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -63,28 +63,15 @@ jobs:
6363
uses: fizyk/actions-reuse/.github/actions/uv-run@42b61e053c1d70a61deb42b323c1a2229e2e7fe0 # v5.5.0
6464
with:
6565
command: pip install -r oldest/requirements.txt
66-
- name: Run tests without xdist
67-
id: run_serial_tests
68-
uses: fizyk/actions-reuse/.github/actions/uv-run@42b61e053c1d70a61deb42b323c1a2229e2e7fe0 # v5.5.0
69-
with:
70-
command: python -m coverage run --data-file=.coverage.serial -m pytest -c pyproject.oldest.toml -svv -p no:xdist --postgresql-exec="/usr/lib/postgresql/${{ inputs.postgresql }}/bin/pg_ctl" -k "not docker" --basetemp="${{ runner.temp }}/pytest-basetemp"
71-
env: '{"COVERAGE_PROCESS_START": ".coveragerc", "COVERAGE_FILE": ".coverage.serial"}'
72-
- name: Combine and export serial coverage
73-
if: ${{ always() && (steps.run_serial_tests.conclusion == 'success' || steps.run_serial_tests.conclusion == 'failure') }}
74-
uses: fizyk/actions-reuse/.github/actions/coverage-combine-export-uv@42b61e053c1d70a61deb42b323c1a2229e2e7fe0 # v5.5.0
66+
- uses: fizyk/actions-reuse/.github/actions/uv-pytest-coverage@7eefbd6ffc6c6787ad3be6ce93dcf475e3ae99b5 # v5.6.0
7567
with:
68+
pytest-opts: -c pyproject.oldest.toml -svv -p no:xdist --postgresql-exec="${{ env.POSTGRESQL_EXEC }}" -k "not docker" --basetemp="${{ runner.temp }}/pytest-basetemp"
7669
data-file: .coverage.serial
7770
output-file: coverage-serial.xml
78-
- name: Run xdist test
79-
id: run_xdist_tests
80-
uses: fizyk/actions-reuse/.github/actions/uv-run@42b61e053c1d70a61deb42b323c1a2229e2e7fe0 # v5.5.0
81-
with:
82-
command: python -m coverage run --data-file=.coverage.xdist -m pytest -n auto -c pyproject.oldest.toml --dist loadgroup --max-worker-restart 0 --postgresql-exec="/usr/lib/postgresql/${{ inputs.postgresql }}/bin/pg_ctl" -k "not docker" --basetemp="${{ runner.temp }}/pytest-basetemp"
83-
env: '{"COVERAGE_PROCESS_START": ".coveragerc", "COVERAGE_FILE": ".coverage.xdist"}'
84-
- name: Combine and export xdist coverage
85-
if: ${{ always() && (steps.run_xdist_tests.conclusion == 'success' || steps.run_xdist_tests.conclusion == 'failure') }}
86-
uses: fizyk/actions-reuse/.github/actions/coverage-combine-export-uv@42b61e053c1d70a61deb42b323c1a2229e2e7fe0 # v5.5.0
71+
- uses: fizyk/actions-reuse/.github/actions/uv-pytest-coverage@7eefbd6ffc6c6787ad3be6ce93dcf475e3ae99b5 # v5.6.0
8772
with:
73+
pytest-opts: -n auto -c pyproject.oldest.toml --dist loadgroup --max-worker-restart 0 --postgresql-exec="${{ env.POSTGRESQL_EXEC }}" -k "not docker" --basetemp="${{ runner.temp }}/pytest-basetemp"
74+
coverage-config: .coveragerc
8875
data-file: .coverage.xdist
8976
output-file: coverage-xdist.xml
9077
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1

‎.github/workflows/single-postgres-windows.yml‎

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -46,28 +46,15 @@ jobs:
4646
- uses: ./.github/actions/detect-pg-ctl
4747
with:
4848
postgresql-version: ${{ inputs.postgresql }}
49-
- name: Run test
50-
id: run_serial_tests
51-
uses: fizyk/actions-reuse/.github/actions/uv-run@42b61e053c1d70a61deb42b323c1a2229e2e7fe0 # v5.5.0
52-
with:
53-
command: python -m coverage run --data-file=.coverage.serial -m pytest -svv -p no:xdist --postgresql-exec="${{ env.POSTGRESQL_EXEC }}" -k "not docker" --basetemp="${{ runner.temp }}/pytest-basetemp"
54-
env: '{"COVERAGE_PROCESS_START": ".coveragerc", "COVERAGE_FILE": ".coverage.serial"}'
55-
- name: Combine and export serial coverage
56-
if: ${{ always() && (steps.run_serial_tests.conclusion == 'success' || steps.run_serial_tests.conclusion == 'failure') }}
57-
uses: fizyk/actions-reuse/.github/actions/coverage-combine-export-uv@42b61e053c1d70a61deb42b323c1a2229e2e7fe0 # v5.5.0
49+
- uses: fizyk/actions-reuse/.github/actions/uv-pytest-coverage@7eefbd6ffc6c6787ad3be6ce93dcf475e3ae99b5 # v5.6.0
5850
with:
51+
pytest-opts: -svv -p no:xdist --postgresql-exec="${{ env.POSTGRESQL_EXEC }}" -k "not docker" --basetemp="${{ runner.temp }}/pytest-basetemp"
5952
data-file: .coverage.serial
6053
output-file: coverage-serial.xml
61-
- name: Run xdist test
62-
id: run_xdist_tests
63-
uses: fizyk/actions-reuse/.github/actions/uv-run@42b61e053c1d70a61deb42b323c1a2229e2e7fe0 # v5.5.0
64-
with:
65-
command: python -m coverage run --data-file=.coverage.xdist -m pytest -n auto --dist loadgroup --max-worker-restart 0 --postgresql-exec="${{ env.POSTGRESQL_EXEC }}" -k "not docker" --basetemp="${{ runner.temp }}/pytest-basetemp"
66-
env: '{"COVERAGE_PROCESS_START": ".coveragerc", "COVERAGE_FILE": ".coverage.xdist"}'
67-
- name: Combine and export xdist coverage
68-
if: ${{ always() && (steps.run_xdist_tests.conclusion == 'success' || steps.run_xdist_tests.conclusion == 'failure') }}
69-
uses: fizyk/actions-reuse/.github/actions/coverage-combine-export-uv@42b61e053c1d70a61deb42b323c1a2229e2e7fe0 # v5.5.0
54+
- uses: fizyk/actions-reuse/.github/actions/uv-pytest-coverage@7eefbd6ffc6c6787ad3be6ce93dcf475e3ae99b5 # v5.6.0
7055
with:
56+
pytest-opts: -n auto --dist loadgroup --max-worker-restart 0 --postgresql-exec="${{ env.POSTGRESQL_EXEC }}" -k "not docker" --basetemp="${{ runner.temp }}/pytest-basetemp"
57+
coverage-config: .coveragerc
7158
data-file: .coverage.xdist
7259
output-file: coverage-xdist.xml
7360
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1

‎.github/workflows/single-postgres.yml‎

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -77,28 +77,15 @@ jobs:
7777
- name: install libpq
7878
if: ${{ contains(matrix.python-version, 'pypy') && runner.os == 'Linux' }}
7979
run: sudo apt install libpq5
80-
- name: Run test
81-
id: run_serial_tests
82-
uses: fizyk/actions-reuse/.github/actions/uv-run@42b61e053c1d70a61deb42b323c1a2229e2e7fe0 # v5.5.0
83-
with:
84-
command: python -m coverage run --data-file=.coverage.serial -m pytest -svv -p no:xdist --postgresql-exec="${{ env.POSTGRESQL_EXEC }}" -k "not docker" --basetemp="${{ runner.temp }}/pytest-basetemp"
85-
env: '{"COVERAGE_PROCESS_START": ".coveragerc", "COVERAGE_FILE": ".coverage.serial"}'
86-
- name: Combine and export serial coverage
87-
if: ${{ always() && (steps.run_serial_tests.conclusion == 'success' || steps.run_serial_tests.conclusion == 'failure') }}
88-
uses: fizyk/actions-reuse/.github/actions/coverage-combine-export-uv@42b61e053c1d70a61deb42b323c1a2229e2e7fe0 # v5.5.0
80+
- uses: fizyk/actions-reuse/.github/actions/uv-pytest-coverage@7eefbd6ffc6c6787ad3be6ce93dcf475e3ae99b5 # v5.6.0
8981
with:
82+
pytest-opts: -svv -p no:xdist --postgresql-exec="${{ env.POSTGRESQL_EXEC }}" -k "not docker" --basetemp="${{ runner.temp }}/pytest-basetemp"
9083
data-file: .coverage.serial
9184
output-file: coverage-serial.xml
92-
- name: Run xdist test
93-
id: run_xdist_tests
94-
uses: fizyk/actions-reuse/.github/actions/uv-run@42b61e053c1d70a61deb42b323c1a2229e2e7fe0 # v5.5.0
95-
with:
96-
command: python -m coverage run --data-file=.coverage.xdist -m pytest -n auto --dist loadgroup --max-worker-restart 0 --postgresql-exec="${{ env.POSTGRESQL_EXEC }}" -k "not docker" --basetemp="${{ runner.temp }}/pytest-basetemp"
97-
env: '{"COVERAGE_PROCESS_START": ".coveragerc", "COVERAGE_FILE": ".coverage.xdist"}'
98-
- name: Combine and export xdist coverage
99-
if: ${{ always() && (steps.run_xdist_tests.conclusion == 'success' || steps.run_xdist_tests.conclusion == 'failure') }}
100-
uses: fizyk/actions-reuse/.github/actions/coverage-combine-export-uv@42b61e053c1d70a61deb42b323c1a2229e2e7fe0 # v5.5.0
85+
- uses: fizyk/actions-reuse/.github/actions/uv-pytest-coverage@7eefbd6ffc6c6787ad3be6ce93dcf475e3ae99b5 # v5.6.0
10186
with:
87+
pytest-opts: -n auto --dist loadgroup --max-worker-restart 0 --postgresql-exec="${{ env.POSTGRESQL_EXEC }}" -k "not docker" --basetemp="${{ runner.temp }}/pytest-basetemp"
88+
coverage-config: .coveragerc
10289
data-file: .coverage.xdist
10390
output-file: coverage-xdist.xml
10491
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1

‎newsfragments/1424.misc.rst‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Migrate tests to be based on `actions-reuse` new composite action `uv-pytest-coverage`

0 commit comments

Comments
 (0)