Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
79 changes: 79 additions & 0 deletions .github/workflows/oldest-postgres.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
name: Run pytest tests

on:
workflow_call:
inputs:
python-versions:
description: 'Supported python versions'
default: '["3.9", "3.10", "3.11", "3.12", "3.13", "pypy-3.10"]'
required: false
type: string
postgresql:
description: 'PostgreSQL version'
default: 13
type: number
os:
description: 'Operating system to run tests on'
default: 'ubuntu-latest'
required: false
type: string
secrets:
codecov_token:
description: 'Codecov token'
required: false

jobs:
postgres:
runs-on: ${{ inputs.os }}
strategy:
fail-fast: false
matrix:
python-version: ${{ fromJSON(inputs.python-versions) }}
env:
OS: ${{ inputs.os }}
PYTHON: ${{ matrix.python-version }}
POSTGRES: ${{ inputs.postgresql }}
steps:
- uses: actions/checkout@v4
- name: Set up Pipenv on python ${{ matrix.python-version }}
uses: fizyk/actions-reuse/.github/actions/pipenv-setup@v3.1.0
with:
python-version: ${{ matrix.python-version }}
cache: false
- uses: ankane/setup-postgres@v1
with:
postgres-version: ${{ inputs.postgresql }}
- name: Check installed locales
run: |
locale -a
- name: update locale for tests
if: ${{ inputs.os == 'ubuntu-latest' }}
run: |
sudo locale-gen de_DE.UTF-8
- name: install libpq
if: ${{ contains(inputs.python-versions, 'pypy') }}
run: sudo apt install libpq5
- name: Install oldest supported versions
uses: fizyk/actions-reuse/.github/actions/pipenv-run@v3.1.0
with:
command: pip install -r oldest-requirements.txt
- name: Run tests without xdist
uses: fizyk/actions-reuse/.github/actions/pipenv-run@v3.1.0
with:
command: py.test -svv -p no:xdist --postgresql-exec="/usr/lib/postgresql/${{ inputs.postgresql }}/bin/pg_ctl" -k "not docker" --cov-report=xml
- name: Run xdist test
uses: fizyk/actions-reuse/.github/actions/pipenv-run@v3.1.0
with:
command: py.test -n auto --dist loadgroup --max-worker-restart 0 --postgresql-exec="/usr/lib/postgresql/${{ inputs.postgresql }}/bin/pg_ctl" -k "not docker" --cov-report=xml:coverage-xdist.xml
- uses: actions/upload-artifact@v4
if: failure()
with:
name: postgresql-${{ matrix.python-version }}-${{ inputs.postgresql }}
path: /tmp/pytest-of-runner/**
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5.4.2
with:
token: ${{ secrets.codecov_token }}
flags: unittests
env_vars: OS,PYTHON
fail_ci_if_error: false
3 changes: 3 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ jobs:
uses: ./.github/workflows/single-postgres.yml
with:
postgresql: 17
postgresql_oldest:
needs: [postgresql_17]
uses: ./.github/workflows/oldest-postgres.yml
postgresql_16:
needs: [postgresql_17]
uses: ./.github/workflows/single-postgres.yml
Expand Down
3 changes: 3 additions & 0 deletions newsfragments/1131.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Update minimum required pytest version to 7.2

Additionally added test run of `pytest-postgresql` against oldest supported versions.
4 changes: 4 additions & 0 deletions oldest-requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
pytest == 7.2
port-for == 0.7.3
mirakuru == 2.6.0
psycopg == 3.0.0
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ classifiers = [
"Framework :: Pytest",
]
dependencies = [
"pytest >= 6.2",
"pytest >= 7.2",
"port-for >= 0.7.3",
"mirakuru >= 2.6.0",
"packaging",
Expand Down
Loading