]> git.ipfire.org Git - thirdparty/psycopg.git/commitdiff
ci: test gevent integration
authorDaniele Varrazzo <daniele.varrazzo@gmail.com>
Thu, 30 Nov 2023 10:23:27 +0000 (11:23 +0100)
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>
Fri, 1 Dec 2023 12:56:18 +0000 (13:56 +0100)
.github/workflows/tests.yml
tests/conftest.py
tests/test_gevent.py

index bb897b1ef5af9ac201bf21c6642e5d0230957a04..ac293782fcde4ef64c3d3ed1787081d470f7be5d 100644 (file)
@@ -40,6 +40,8 @@ jobs:
           - {impl: c, python: "3.11", postgres: "postgres:12", libpq: oldest}
           - {impl: c, python: "3.12", postgres: "postgres:10", 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"}
 
@@ -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: |
@@ -91,7 +99,7 @@ jobs:
       - name: Configure to use the oldest dependencies
         if: ${{ matrix.ext == 'min' }}
         run: |
-          echo "DEPS=$DEPS dnspython shapely" >> $GITHUB_ENV
+          echo "DEPS=$DEPS dnspython shapely gevent" >> $GITHUB_ENV
           echo "PIP_CONSTRAINT=${{ github.workspace }}/tests/constraints.txt" \
             >> $GITHUB_ENV
 
index 1ec997bf9872e291bb1e50d9eb9834c147c5e31e..de2b24fc751664e0f62815d7c710c5e61688a8c6 100644 (file)
@@ -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",
     ]
index 99027aee34e9a7c83599f19131b52ea18955de15..befbeb21943bae254a0be7bbc45974015f43891a 100644 (file)
@@ -7,6 +7,8 @@ import psycopg
 
 pytest.importorskip("gevent")
 
+pytestmark = [pytest.mark.gevent]
+
 
 @pytest.mark.slow
 @pytest.mark.timing