Quellcode durchsuchen

test: use pytest-ignore-flaky instead of xfail

Nicolas Duchon vor 1 Monat
Ursprung
Commit
af1c403d74

+ 1 - 1
.github/workflows/test.yml

@@ -50,5 +50,5 @@ jobs:
         run: make build-nginx-proxy-test-${{ matrix.base_docker_image }}
 
       - name: Run tests
-        run: pytest
+        run: pytest --ignore-flaky
         working-directory: test

+ 1 - 0
test/requirements/python-requirements.txt

@@ -2,5 +2,6 @@ backoff==2.2.1
 docker==7.1.0
 packaging==25.0
 pytest==8.4.1
+pytest-ignore-flaky==2.2.1
 requests==2.32.4
 urllib3==2.5.0

+ 2 - 2
test/test_dockergen/test_dockergen_network_segregation-custom-label.py

@@ -1,13 +1,13 @@
 import pytest
 
 
-@pytest.mark.xfail(reason="flaky test")
+@pytest.mark.flaky
 def test_unknown_virtual_host_is_503(docker_compose, nginxproxy):
     r = nginxproxy.get("http://unknown.nginx-proxy.tld/")
     assert r.status_code == 503
 
 
-@pytest.mark.xfail(reason="flaky test")
+@pytest.mark.flaky
 def test_forwards_to_whoami(docker_compose, nginxproxy):
     r = nginxproxy.get("http://whoami2.nginx-proxy.tld/")
     assert r.status_code == 200

+ 2 - 2
test/test_dockergen/test_dockergen_network_segregation.py

@@ -1,13 +1,13 @@
 import pytest
 
 
-@pytest.mark.xfail(reason="flaky test")
+@pytest.mark.flaky
 def test_unknown_virtual_host_is_503(docker_compose, nginxproxy):
     r = nginxproxy.get("http://unknown.nginx-proxy.tld/")
     assert r.status_code == 503
 
 
-@pytest.mark.xfail(reason="flaky test")
+@pytest.mark.flaky
 def test_forwards_to_whoami(docker_compose, nginxproxy):
     r = nginxproxy.get("http://whoami2.nginx-proxy.tld/")
     assert r.status_code == 200