]> git.ipfire.org Git - thirdparty/psycopg.git/commitdiff
Skip proxy-based tests on MacOS tests
authorDaniele Varrazzo <daniele.varrazzo@gmail.com>
Tue, 29 Jun 2021 00:08:30 +0000 (01:08 +0100)
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>
Tue, 29 Jun 2021 01:36:33 +0000 (02:36 +0100)
The proxy doesn't start in time 2s seem plenty.

.github/workflows/tests.yml
tests/fix_proxy.py

index cae4ff92e55b3f18224edce85614fd342e0cf09f..bac134cde5a9f8729ce569b297236d3cdd50bdad 100644 (file)
@@ -123,7 +123,8 @@ jobs:
       PSYCOPG_TEST_DSN: "host=127.0.0.1 user=runner dbname=postgres"
       # MacOS on GitHub Actions seems particularly slow.
       # Don't run timing-based tests as they regularly fail.
-      PYTEST_ADDOPTS: "-m 'not timing'"
+      # pproxy-based tests fail too, with the proxy not coming up in 2s.
+      PYTEST_ADDOPTS: "-m 'not timing and not proxy'"
 
     steps:
       - uses: actions/checkout@v2
index ef87b6397e7e7e1c11b5b719e957a86cb7a04255..4128bcb54da5cfd704ed654e47985a9e5789d5be 100644 (file)
@@ -12,6 +12,20 @@ from psycopg import conninfo
 logger = logging.getLogger()
 
 
+def pytest_collection_modifyitems(items):
+    for item in items:
+        if "proxy" in item.fixturenames:
+            item.add_marker(pytest.mark.proxy)
+
+
+def pytest_configure(config):
+    config.addinivalue_line(
+        "markers",
+        "proxy: the test uses pproxy (the marker is set automatically"
+        " on tests using the fixture)",
+    )
+
+
 @pytest.fixture
 def proxy(dsn):
     """Return a proxy to the --test-dsn database"""