From 1ee2b3f48f921fc46bfaa2f6ef316fa1f745ef87 Mon Sep 17 00:00:00 2001 From: Daniele Varrazzo Date: Thu, 30 Nov 2023 11:23:27 +0100 Subject: [PATCH] ci: test gevent integration --- .github/workflows/tests.yml | 10 +++++++++- tests/conftest.py | 1 + tests/test_gevent.py | 2 ++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 690c9e98e..a1195fe27 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -38,6 +38,8 @@ jobs: - {impl: c, python: "3.11", postgres: "postgres:12", libpq: oldest} - {impl: c, python: "3.12", postgres: "postgres:11", libpq: newest} + - {impl: python, python: "3.8", ext: gevent, postgres: "postgres:16"} + - {impl: c, python: "3.12", ext: gevent, postgres: "postgres:14"} - {impl: python, python: "3.9", ext: dns, postgres: "postgres:14"} - {impl: python, python: "3.9", ext: postgis, postgres: "postgis/postgis"} - {impl: python, python: "3.10", ext: numpy, postgres: "postgres:14"} @@ -76,6 +78,12 @@ jobs: run: | echo "DEPS=$DEPS ./psycopg_c" >> $GITHUB_ENV + - name: Include gevent to the packages to install + if: ${{ matrix.ext == 'gevent' }} + run: | + echo "DEPS=$DEPS gevent" >> $GITHUB_ENV + echo "MARKERS=$MARKERS gevent" >> $GITHUB_ENV + - name: Include dnspython to the packages to install if: ${{ matrix.ext == 'dns' }} run: | @@ -96,7 +104,7 @@ jobs: - name: Configure to use the oldest dependencies if: ${{ matrix.ext == 'min' }} run: | - echo "DEPS=$DEPS dnspython shapely numpy" >> $GITHUB_ENV + echo "DEPS=$DEPS dnspython shapely numpy gevent" >> $GITHUB_ENV echo "PIP_CONSTRAINT=${{ github.workspace }}/tests/constraints.txt" \ >> $GITHUB_ENV diff --git a/tests/conftest.py b/tests/conftest.py index 05d79f999..8438fc6c6 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -25,6 +25,7 @@ def pytest_configure(config): # catch the exception for my life. "subprocess: the test import psycopg after subprocess", "timing: the test is timing based and can fail on cheese hardware", + "gevent: the test requires the gevent module to be installed", "dns: the test requires dnspython to run", "postgis: the test requires the PostGIS extension to run", "numpy: the test requires numpy module to be installed", diff --git a/tests/test_gevent.py b/tests/test_gevent.py index 99027aee3..befbeb219 100644 --- a/tests/test_gevent.py +++ b/tests/test_gevent.py @@ -7,6 +7,8 @@ import psycopg pytest.importorskip("gevent") +pytestmark = [pytest.mark.gevent] + @pytest.mark.slow @pytest.mark.timing -- 2.39.5