diff --git a/.github/workflows/async-postgres.yml b/.github/workflows/async-postgres.yml deleted file mode 100644 index e7e7fffc..00000000 --- a/.github/workflows/async-postgres.yml +++ /dev/null @@ -1,80 +0,0 @@ -name: Run async extra pytest tests - -on: - workflow_call: - inputs: - python-version: - description: 'Python version' - default: '3.12' - required: false - type: string - postgresql: - description: 'PostgreSQL version' - required: true - type: number - os: - description: 'Operating system to run tests on' - default: 'ubuntu-latest' - required: false - type: string - -permissions: - contents: read - -jobs: - async-extra: - runs-on: ${{ inputs.os }} - timeout-minutes: 30 - env: - OS: ${{ inputs.os }} - PYTHON: ${{ inputs.python-version }} - POSTGRES: ${{ inputs.postgresql }} - steps: - - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - persist-credentials: false - - name: Set up Python ${{ inputs.python-version }} - uses: fizyk/actions-reuse/.github/actions/uv-setup@06f5123d5a89db10f394aaa1533a5c119b34a48f # v5.10.1 - with: - python-version: ${{ inputs.python-version }} - # ankane/setup-postgres publishes no tags/releases; v1 is a branch. Pinning - # to a SHA gains nothing (Dependabot can't track a branch). Revisit if the - # maintainer adds releases. See https://docs.zizmor.sh/audits/#unpinned-uses - - uses: ankane/setup-postgres@v1 # zizmor: ignore[unpinned-uses] - with: - postgres-version: ${{ inputs.postgresql }} - - name: Set PostgreSQL path on Linux - if: runner.os != 'Windows' - run: | - if command -v pg_ctl >/dev/null 2>&1; then - PG_CTL_PATH=$(command -v pg_ctl) - echo "POSTGRESQL_EXEC=$PG_CTL_PATH" >> "$GITHUB_ENV" - elif [ -f "/opt/homebrew/opt/postgresql@${{ inputs.postgresql }}/bin/pg_ctl" ]; then - echo "POSTGRESQL_EXEC=/opt/homebrew/opt/postgresql@${{ inputs.postgresql }}/bin/pg_ctl" >> "$GITHUB_ENV" - elif [ -f "/usr/local/opt/postgresql@${{ inputs.postgresql }}/bin/pg_ctl" ]; then - echo "POSTGRESQL_EXEC=/usr/local/opt/postgresql@${{ inputs.postgresql }}/bin/pg_ctl" >> "$GITHUB_ENV" - elif [ -f "/usr/lib/postgresql/${{ inputs.postgresql }}/bin/pg_ctl" ]; then - echo "POSTGRESQL_EXEC=/usr/lib/postgresql/${{ inputs.postgresql }}/bin/pg_ctl" >> "$GITHUB_ENV" - else - echo "Error: pg_ctl not found in expected locations" - exit 1 - fi - - name: update locale for tests - if: startsWith(inputs.os, 'ubuntu') - run: | - sudo locale-gen de_DE.UTF-8 - - name: Run async tests on Unix - if: runner.os != 'Windows' - uses: fizyk/actions-reuse/.github/actions/uv-run@06f5123d5a89db10f394aaa1533a5c119b34a48f # v5.10.1 - with: - command: python -m pytest -svv -m asyncio -p no:xdist --postgresql-exec="${{ env.POSTGRESQL_EXEC }}" -k "not docker" --basetemp="${{ runner.temp }}/pytest-basetemp" - - name: Run async tests on Windows - if: runner.os == 'Windows' - uses: fizyk/actions-reuse/.github/actions/uv-run@06f5123d5a89db10f394aaa1533a5c119b34a48f # v5.10.1 - with: - command: python -m pytest -svv -m asyncio -p no:xdist -k "not docker" --basetemp="${{ runner.temp }}/pytest-basetemp" - - uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 - if: failure() - with: - name: postgresql-async-${{ inputs.python-version }}-${{ inputs.postgresql }}-${{ inputs.os }} - path: ${{ runner.temp }}/pytest-basetemp/** diff --git a/.github/workflows/dockerised-postgres.yml b/.github/workflows/dockerised-postgres.yml deleted file mode 100644 index 9facd96d..00000000 --- a/.github/workflows/dockerised-postgres.yml +++ /dev/null @@ -1,72 +0,0 @@ -name: Run pytest tests - -on: - workflow_call: - inputs: - python-versions: - description: 'Supported python versions' - default: '["3.11", "3.12", "3.13", "3.14", "3.15"]' - required: false - type: string - postgresql: - description: 'PostgreSQL version' - required: true - type: number - secrets: - codecov_token: - description: 'Codecov token' - required: false - -jobs: - postgres: - runs-on: 'ubuntu-latest' - timeout-minutes: 30 - strategy: - fail-fast: false - matrix: - python-version: ${{ fromJSON(inputs.python-versions) }} - env: - PYTHON: ${{ matrix.python-version }} - POSTGRES: ${{ inputs.postgresql }} - # Service containers to run with `container-job` - services: - # Label used to access the service container - postgres: - # Docker Hub image: - image: postgres:${{ inputs.postgresql }} - # Provide the password for postgres - env: - POSTGRES_PASSWORD: postgres - # Set health checks to wait until postgres has started - options: >- - --health-cmd pg_isready - --health-interval 10s - --health-timeout 5s - --health-retries 5 - ports: - # Maps tcp port 5432 on service container to the host - - 5433:5432 - - steps: - - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - persist-credentials: false - - name: Set up uv with python ${{ matrix.python-version }} - uses: fizyk/actions-reuse/.github/actions/uv-setup@06f5123d5a89db10f394aaa1533a5c119b34a48f # v5.10.1 - with: - python-version: ${{ matrix.python-version }} - - name: Run test noproc fixture on docker - uses: fizyk/actions-reuse/.github/actions/uv-pytest-coverage@06f5123d5a89db10f394aaa1533a5c119b34a48f # v5.10.1 - with: - pytest-opts: -n 0 --max-worker-restart 0 -k docker --postgresql-host=localhost --postgresql-port 5433 --postgresql-password=postgres - data-file: .coverage.docker - output-file: coverage-docker.xml - - name: Upload coverage to Codecov - if: always() - uses: codecov/codecov-action@303a32d7a59b442fa8d48b6a1cc6825c09c847a5 # v6.0.1 - with: - token: ${{ secrets.codecov_token }} - flags: unittests - env_vars: PYTHON - fail_ci_if_error: false - files: coverage-docker.xml diff --git a/.github/workflows/single-postgres.yml b/.github/workflows/tests-linux.yml similarity index 58% rename from .github/workflows/single-postgres.yml rename to .github/workflows/tests-linux.yml index 923e7c93..e5e835cd 100644 --- a/.github/workflows/single-postgres.yml +++ b/.github/workflows/tests-linux.yml @@ -1,4 +1,4 @@ -name: Run pytest tests +name: Run pytest tests on Linux on: workflow_call: @@ -12,11 +12,6 @@ on: description: 'PostgreSQL version' required: true type: number - os: - description: 'Operating system to run tests on' - default: 'ubuntu-latest' - required: false - type: string secrets: codecov_token: description: 'Codecov token' @@ -24,16 +19,32 @@ on: jobs: postgres: - runs-on: ${{ inputs.os }} + runs-on: ubuntu-latest timeout-minutes: 30 strategy: fail-fast: false matrix: python-version: ${{ fromJSON(inputs.python-versions) }} env: - OS: ${{ inputs.os }} + OS: ubuntu-latest PYTHON: ${{ matrix.python-version }} POSTGRES: ${{ inputs.postgresql }} + POSTGRESQL_EXEC: /usr/lib/postgresql/${{ inputs.postgresql }}/bin/pg_ctl + # PostgreSQL in a container, for the noproc fixture tests (-k docker) + services: + postgres: + image: postgres:${{ inputs.postgresql }} + env: + POSTGRES_PASSWORD: postgres + # Set health checks to wait until postgres has started + options: >- + --health-cmd pg_isready + --health-interval 10s + --health-timeout 5s + --health-retries 5 + ports: + # Maps tcp port 5432 on service container to the host + - 5433:5432 steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: @@ -48,34 +59,14 @@ jobs: - uses: ankane/setup-postgres@v1 # zizmor: ignore[unpinned-uses] with: postgres-version: ${{ inputs.postgresql }} - - name: Set PostgreSQL path - run: | - # Try to find pg_ctl dynamically for cross-platform compatibility - if command -v pg_ctl >/dev/null 2>&1; then - PG_CTL_PATH=$(command -v pg_ctl) - echo "POSTGRESQL_EXEC=$PG_CTL_PATH" >> "$GITHUB_ENV" - elif [ -f "/opt/homebrew/opt/postgresql@${{ inputs.postgresql }}/bin/pg_ctl" ]; then - # macOS Apple Silicon Homebrew path - echo "POSTGRESQL_EXEC=/opt/homebrew/opt/postgresql@${{ inputs.postgresql }}/bin/pg_ctl" >> "$GITHUB_ENV" - elif [ -f "/usr/local/opt/postgresql@${{ inputs.postgresql }}/bin/pg_ctl" ]; then - # macOS Intel Homebrew path - echo "POSTGRESQL_EXEC=/usr/local/opt/postgresql@${{ inputs.postgresql }}/bin/pg_ctl" >> "$GITHUB_ENV" - elif [ -f "/usr/lib/postgresql/${{ inputs.postgresql }}/bin/pg_ctl" ]; then - # Debian/Ubuntu path (fallback) - echo "POSTGRESQL_EXEC=/usr/lib/postgresql/${{ inputs.postgresql }}/bin/pg_ctl" >> "$GITHUB_ENV" - else - echo "Error: pg_ctl not found in expected locations" - exit 1 - fi - 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(matrix.python-version, 'pypy') && runner.os == 'Linux' }} + if: ${{ contains(matrix.python-version, 'pypy') }} run: sudo apt install libpq5 - uses: fizyk/actions-reuse/.github/actions/uv-pytest-coverage@06f5123d5a89db10f394aaa1533a5c119b34a48f # v5.10.1 with: @@ -88,10 +79,27 @@ jobs: coverage-config: .coveragerc data-file: .coverage.xdist output-file: coverage-xdist.xml + - name: Run test noproc fixture on docker + uses: fizyk/actions-reuse/.github/actions/uv-pytest-coverage@06f5123d5a89db10f394aaa1533a5c119b34a48f # v5.10.1 + with: + pytest-opts: -n 0 --max-worker-restart 0 -k docker --postgresql-host=localhost --postgresql-port 5433 --postgresql-password=postgres --basetemp="${{ runner.temp }}/pytest-basetemp" + data-file: .coverage.docker + output-file: coverage-docker.xml + # Keep this run last: it removes the async extra from the environment. + - name: Remove async extra + run: uv pip uninstall pytest-asyncio aiofiles + - name: Run tests without async extra + uses: fizyk/actions-reuse/.github/actions/uv-pytest-coverage@06f5123d5a89db10f394aaa1533a5c119b34a48f # v5.10.1 + with: + pytest-opts: -svv -p no:xdist -m "not asyncio" --postgresql-exec="${{ env.POSTGRESQL_EXEC }}" -k "not docker" --basetemp="${{ runner.temp }}/pytest-basetemp" + data-file: .coverage.noasync + output-file: coverage-noasync.xml + # Without it, uv run re-syncs the environment and reinstalls the extra. + env: '{"UV_NO_SYNC": "1"}' - uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 if: failure() with: - name: postgresql-${{ matrix.python-version }}-${{ inputs.postgresql }} + name: postgresql-linux-${{ matrix.python-version }}-${{ inputs.postgresql }} path: ${{ runner.temp }}/pytest-basetemp/** - name: Upload coverage to Codecov if: always() @@ -101,4 +109,4 @@ jobs: flags: unittests env_vars: OS,PYTHON fail_ci_if_error: false - files: coverage-serial.xml,coverage-xdist.xml + files: coverage-serial.xml,coverage-xdist.xml,coverage-docker.xml,coverage-noasync.xml diff --git a/.github/workflows/oldest-postgres.yml b/.github/workflows/tests-macos.yml similarity index 66% rename from .github/workflows/oldest-postgres.yml rename to .github/workflows/tests-macos.yml index 329792d2..a14ae2a3 100644 --- a/.github/workflows/oldest-postgres.yml +++ b/.github/workflows/tests-macos.yml @@ -1,4 +1,4 @@ -name: Run pytest tests +name: Run pytest tests on macOS on: workflow_call: @@ -10,13 +10,8 @@ on: type: string postgresql: description: 'PostgreSQL version' - default: 14 + required: true type: number - os: - description: 'Operating system to run tests on' - default: 'ubuntu-latest' - required: false - type: string secrets: codecov_token: description: 'Codecov token' @@ -24,17 +19,16 @@ on: jobs: postgres: - runs-on: ${{ inputs.os }} + runs-on: macos-latest timeout-minutes: 30 strategy: fail-fast: false matrix: python-version: ${{ fromJSON(inputs.python-versions) }} env: - OS: ${{ inputs.os }} + OS: macos-latest PYTHON: ${{ matrix.python-version }} POSTGRES: ${{ inputs.postgresql }} - UV_NO_SYNC: "1" steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: @@ -43,42 +37,33 @@ jobs: uses: fizyk/actions-reuse/.github/actions/uv-setup@06f5123d5a89db10f394aaa1533a5c119b34a48f # v5.10.1 with: python-version: ${{ matrix.python-version }} - cache: false # ankane/setup-postgres publishes no tags/releases; v1 is a branch. Pinning # to a SHA gains nothing (Dependabot can't track a branch). Revisit if the # maintainer adds releases. See https://docs.zizmor.sh/audits/#unpinned-uses - uses: ankane/setup-postgres@v1 # zizmor: ignore[unpinned-uses] with: postgres-version: ${{ inputs.postgresql }} + - name: Set PostgreSQL path + run: | + echo "POSTGRESQL_EXEC=$(brew --prefix "postgresql@${POSTGRES}")/bin/pg_ctl" >> "$GITHUB_ENV" - 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(matrix.python-version, 'pypy') && runner.os == 'Linux' }} - run: sudo apt install libpq5 - - name: Install oldest supported versions - uses: fizyk/actions-reuse/.github/actions/uv-pip@06f5123d5a89db10f394aaa1533a5c119b34a48f # v5.10.1 - with: - requirements: oldest/requirements.txt - uses: fizyk/actions-reuse/.github/actions/uv-pytest-coverage@06f5123d5a89db10f394aaa1533a5c119b34a48f # v5.10.1 with: - pytest-opts: -c pyproject.oldest.toml -svv -p no:xdist --postgresql-exec="${{ env.POSTGRESQL_EXEC }}" -k "not docker" --basetemp="${{ runner.temp }}/pytest-basetemp" + pytest-opts: -svv -p no:xdist --postgresql-exec="${{ env.POSTGRESQL_EXEC }}" -k "not docker" --basetemp="${{ runner.temp }}/pytest-basetemp" data-file: .coverage.serial output-file: coverage-serial.xml - uses: fizyk/actions-reuse/.github/actions/uv-pytest-coverage@06f5123d5a89db10f394aaa1533a5c119b34a48f # v5.10.1 with: - 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" + pytest-opts: -n auto --dist loadgroup --max-worker-restart 0 --postgresql-exec="${{ env.POSTGRESQL_EXEC }}" -k "not docker" --basetemp="${{ runner.temp }}/pytest-basetemp" coverage-config: .coveragerc data-file: .coverage.xdist output-file: coverage-xdist.xml - uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 if: failure() with: - name: postgresql-${{ matrix.python-version }}-${{ inputs.postgresql }} + name: postgresql-macos-${{ matrix.python-version }}-${{ inputs.postgresql }} path: ${{ runner.temp }}/pytest-basetemp/** - name: Upload coverage to Codecov if: always() diff --git a/.github/workflows/tests-oldest.yml b/.github/workflows/tests-oldest.yml new file mode 100644 index 00000000..d9020ca6 --- /dev/null +++ b/.github/workflows/tests-oldest.yml @@ -0,0 +1,117 @@ +name: Run pytest tests on oldest supported versions + +on: + workflow_call: + inputs: + python-versions: + description: 'Supported python versions' + default: '["3.11", "3.12", "3.13", "3.14", "3.15", "pypy-3.11"]' + required: false + type: string + postgresql: + description: 'PostgreSQL version' + default: 14 + type: number + secrets: + codecov_token: + description: 'Codecov token' + required: false + +jobs: + postgres: + runs-on: ubuntu-latest + timeout-minutes: 30 + strategy: + fail-fast: false + matrix: + python-version: ${{ fromJSON(inputs.python-versions) }} + env: + OS: ubuntu-latest + PYTHON: ${{ matrix.python-version }} + POSTGRES: ${{ inputs.postgresql }} + POSTGRESQL_EXEC: /usr/lib/postgresql/${{ inputs.postgresql }}/bin/pg_ctl + UV_NO_SYNC: "1" + # PostgreSQL in a container, for the noproc fixture tests (-k docker) + services: + postgres: + image: postgres:${{ inputs.postgresql }} + env: + POSTGRES_PASSWORD: postgres + # Set health checks to wait until postgres has started + options: >- + --health-cmd pg_isready + --health-interval 10s + --health-timeout 5s + --health-retries 5 + ports: + # Maps tcp port 5432 on service container to the host + - 5433:5432 + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false + - name: Set up uv with python ${{ matrix.python-version }} + uses: fizyk/actions-reuse/.github/actions/uv-setup@06f5123d5a89db10f394aaa1533a5c119b34a48f # v5.10.1 + with: + python-version: ${{ matrix.python-version }} + cache: false + # ankane/setup-postgres publishes no tags/releases; v1 is a branch. Pinning + # to a SHA gains nothing (Dependabot can't track a branch). Revisit if the + # maintainer adds releases. See https://docs.zizmor.sh/audits/#unpinned-uses + - uses: ankane/setup-postgres@v1 # zizmor: ignore[unpinned-uses] + with: + postgres-version: ${{ inputs.postgresql }} + - name: Check installed locales + run: | + locale -a + - name: update locale for tests + run: | + sudo locale-gen de_DE.UTF-8 + - name: install libpq + if: ${{ contains(matrix.python-version, 'pypy') }} + run: sudo apt install libpq5 + - name: Install oldest supported versions + uses: fizyk/actions-reuse/.github/actions/uv-pip@06f5123d5a89db10f394aaa1533a5c119b34a48f # v5.10.1 + with: + requirements: oldest/requirements.txt + - uses: fizyk/actions-reuse/.github/actions/uv-pytest-coverage@06f5123d5a89db10f394aaa1533a5c119b34a48f # v5.10.1 + with: + pytest-opts: -c pyproject.oldest.toml -svv -p no:xdist --postgresql-exec="${{ env.POSTGRESQL_EXEC }}" -k "not docker" --basetemp="${{ runner.temp }}/pytest-basetemp" + data-file: .coverage.serial + output-file: coverage-serial.xml + - uses: fizyk/actions-reuse/.github/actions/uv-pytest-coverage@06f5123d5a89db10f394aaa1533a5c119b34a48f # v5.10.1 + with: + 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" + coverage-config: .coveragerc + data-file: .coverage.xdist + output-file: coverage-xdist.xml + - name: Run test noproc fixture on docker + uses: fizyk/actions-reuse/.github/actions/uv-pytest-coverage@06f5123d5a89db10f394aaa1533a5c119b34a48f # v5.10.1 + with: + pytest-opts: -c pyproject.oldest.toml -n 0 --max-worker-restart 0 -k docker --postgresql-host=localhost --postgresql-port 5433 --postgresql-password=postgres --basetemp="${{ runner.temp }}/pytest-basetemp" + data-file: .coverage.docker + output-file: coverage-docker.xml + # Keep this run last: it removes the async extra from the environment. + # UV_NO_SYNC is set for the whole job, so uv run won't reinstall it. + - name: Remove async extra + run: uv pip uninstall pytest-asyncio aiofiles + - name: Run tests without async extra + uses: fizyk/actions-reuse/.github/actions/uv-pytest-coverage@06f5123d5a89db10f394aaa1533a5c119b34a48f # v5.10.1 + with: + pytest-opts: -c pyproject.oldest.toml -svv -p no:xdist -m "not asyncio" --postgresql-exec="${{ env.POSTGRESQL_EXEC }}" -k "not docker" --basetemp="${{ runner.temp }}/pytest-basetemp" + data-file: .coverage.noasync + output-file: coverage-noasync.xml + - uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 + if: failure() + with: + name: postgresql-oldest-${{ matrix.python-version }}-${{ inputs.postgresql }} + path: ${{ runner.temp }}/pytest-basetemp/** + - name: Upload coverage to Codecov + if: always() + uses: codecov/codecov-action@303a32d7a59b442fa8d48b6a1cc6825c09c847a5 # v6.0.1 + with: + token: ${{ secrets.codecov_token }} + flags: unittests + env_vars: OS,PYTHON + fail_ci_if_error: false + files: coverage-serial.xml,coverage-xdist.xml,coverage-docker.xml,coverage-noasync.xml diff --git a/.github/workflows/single-postgres-windows.yml b/.github/workflows/tests-windows.yml similarity index 100% rename from .github/workflows/single-postgres-windows.yml rename to .github/workflows/tests-windows.yml diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index e2018a96..e9c8f8f6 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -10,39 +10,23 @@ jobs: postgresql_18: permissions: contents: read - uses: $/.github/workflows/single-postgres.yml + uses: $/.github/workflows/tests-linux.yml with: postgresql: 18 secrets: codecov_token: ${{ secrets.CODECOV_TOKEN }} - postgresql_async_extra: - permissions: - contents: read - uses: $/.github/workflows/async-postgres.yml - with: - postgresql: 18 - python-version: '3.12' - os: ubuntu-latest - windows_postgres_async_extra: - permissions: - contents: read - uses: $/.github/workflows/async-postgres.yml - with: - postgresql: 17 - python-version: '3.14' - os: windows-latest postgresql_oldest: needs: [postgresql_18] permissions: contents: read - uses: $/.github/workflows/oldest-postgres.yml + uses: $/.github/workflows/tests-oldest.yml secrets: codecov_token: ${{ secrets.CODECOV_TOKEN }} postgresql_17: needs: [postgresql_18] permissions: contents: read - uses: $/.github/workflows/single-postgres.yml + uses: $/.github/workflows/tests-linux.yml with: postgresql: 17 python-versions: '["3.12", "3.13", "3.14", "3.15", "pypy-3.11"]' @@ -52,7 +36,7 @@ jobs: needs: [postgresql_17] permissions: contents: read - uses: $/.github/workflows/single-postgres.yml + uses: $/.github/workflows/tests-linux.yml with: postgresql: 16 python-versions: '["3.13", "3.14", "3.15"]' @@ -62,7 +46,7 @@ jobs: needs: [postgresql_16] permissions: contents: read - uses: $/.github/workflows/single-postgres.yml + uses: $/.github/workflows/tests-linux.yml with: postgresql: 15 python-versions: '["3.14", "3.15"]' @@ -72,7 +56,7 @@ jobs: needs: [postgresql_15] permissions: contents: read - uses: $/.github/workflows/single-postgres.yml + uses: $/.github/workflows/tests-linux.yml with: postgresql: 14 python-versions: '["3.14", "3.15"]' @@ -82,10 +66,9 @@ jobs: needs: [postgresql_18] permissions: contents: read - uses: $/.github/workflows/single-postgres.yml + uses: $/.github/workflows/tests-macos.yml with: postgresql: 18 - os: macos-latest python-versions: '["3.13", "3.14", "3.15"]' secrets: codecov_token: ${{ secrets.CODECOV_TOKEN }} @@ -93,10 +76,9 @@ jobs: needs: [postgresql_17, macos_postgres_18] permissions: contents: read - uses: $/.github/workflows/single-postgres.yml + uses: $/.github/workflows/tests-macos.yml with: postgresql: 17 - os: macos-latest python-versions: '["3.13", "3.14", "3.15"]' secrets: codecov_token: ${{ secrets.CODECOV_TOKEN }} @@ -104,10 +86,9 @@ jobs: needs: [postgresql_16, macos_postgres_17] permissions: contents: read - uses: $/.github/workflows/single-postgres.yml + uses: $/.github/workflows/tests-macos.yml with: postgresql: 16 - os: macos-latest python-versions: '["3.14", "3.15"]' secrets: codecov_token: ${{ secrets.CODECOV_TOKEN }} @@ -115,58 +96,9 @@ jobs: needs: [postgresql_17] permissions: contents: read - uses: $/.github/workflows/single-postgres-windows.yml - with: - postgresql: 17 - python-versions: '["3.13", "3.14", "3.15"]' - secrets: - codecov_token: ${{ secrets.CODECOV_TOKEN }} - docker_postgresql_18: - needs: [postgresql_18] - permissions: - contents: read - uses: $/.github/workflows/dockerised-postgres.yml - with: - postgresql: 18 - secrets: - codecov_token: ${{ secrets.CODECOV_TOKEN }} - docker_postgresql_17: - needs: [postgresql_17, docker_postgresql_18] - permissions: - contents: read - uses: $/.github/workflows/dockerised-postgres.yml + uses: $/.github/workflows/tests-windows.yml with: postgresql: 17 - python-versions: '["3.12", "3.13", "3.14", "3.15"]' - secrets: - codecov_token: ${{ secrets.CODECOV_TOKEN }} - docker_postgresql_16: - needs: [postgresql_16, docker_postgresql_18] - permissions: - contents: read - uses: $/.github/workflows/dockerised-postgres.yml - with: - postgresql: 16 python-versions: '["3.13", "3.14", "3.15"]' secrets: codecov_token: ${{ secrets.CODECOV_TOKEN }} - docker_postgresql_15: - needs: [postgresql_15, docker_postgresql_16] - permissions: - contents: read - uses: $/.github/workflows/dockerised-postgres.yml - with: - postgresql: 15 - python-versions: '["3.14", "3.15"]' - secrets: - codecov_token: ${{ secrets.CODECOV_TOKEN }} - docker_postgresql_14: - needs: [postgresql_14, docker_postgresql_15] - permissions: - contents: read - uses: $/.github/workflows/dockerised-postgres.yml - with: - postgresql: 14 - python-versions: '["3.14", "3.15"]' - secrets: - codecov_token: ${{ secrets.CODECOV_TOKEN }} diff --git a/newsfragments/1476.misc.rst b/newsfragments/1476.misc.rst new file mode 100644 index 00000000..3bd67f79 --- /dev/null +++ b/newsfragments/1476.misc.rst @@ -0,0 +1 @@ +Run docker and async-extra-less tests as steps of the regular test jobs, split test workflows per OS diff --git a/tests/test_postgres_options_plugin.py b/tests/test_postgres_options_plugin.py index f61decfa..d45cd1e2 100644 --- a/tests/test_postgres_options_plugin.py +++ b/tests/test_postgres_options_plugin.py @@ -251,6 +251,7 @@ def test_postgres_drop_test_database_async( Mirrors ``test_postgres_drop_test_database`` but runs an async subprocess test that uses ``postgresql_async`` against the same live PostgreSQL process. """ + pytest.importorskip("pytest_asyncio") _run_drop_test_database_case( postgresql_proc_to_override, pointed_pytester,