fix: pytest -m live works without extra flags
Root cause: test_schemathesis.py mutates decnet.web.auth.SECRET_KEY at module-level import time, poisoning JWT verification for all other tests in the same process — even when fuzz tests are deselected. - Add pytest_ignore_collect hook in tests/api/conftest.py to skip collecting test_schemathesis.py unless -m fuzz is selected - Add --dist loadscope to addopts so xdist groups by module (protects module-scoped fixtures in live tests) - Remove now-unnecessary xdist_group markers from live test classes
This commit is contained in:
@@ -97,7 +97,6 @@ async def token(live_client):
|
||||
|
||||
|
||||
@pytest.mark.live
|
||||
@pytest.mark.xdist_group("health_live")
|
||||
class TestHealthLive:
|
||||
"""Live integration tests — real DB, real Docker check, real task state."""
|
||||
|
||||
|
||||
@@ -128,7 +128,6 @@ async def token(live_client):
|
||||
|
||||
|
||||
@pytest.mark.live
|
||||
@pytest.mark.xdist_group("service_isolation_live")
|
||||
class TestCollectorLiveIsolation:
|
||||
"""Real collector behaviour against the actual Docker daemon."""
|
||||
|
||||
@@ -204,7 +203,6 @@ class TestCollectorLiveIsolation:
|
||||
|
||||
|
||||
@pytest.mark.live
|
||||
@pytest.mark.xdist_group("service_isolation_live")
|
||||
class TestIngesterLiveIsolation:
|
||||
"""Real ingester against real DB and real filesystem."""
|
||||
|
||||
@@ -314,7 +312,6 @@ class TestIngesterLiveIsolation:
|
||||
|
||||
|
||||
@pytest.mark.live
|
||||
@pytest.mark.xdist_group("service_isolation_live")
|
||||
class TestAttackerWorkerLiveIsolation:
|
||||
"""Real attacker worker against real DB."""
|
||||
|
||||
@@ -363,7 +360,6 @@ class TestAttackerWorkerLiveIsolation:
|
||||
|
||||
|
||||
@pytest.mark.live
|
||||
@pytest.mark.xdist_group("service_isolation_live")
|
||||
class TestSnifferLiveIsolation:
|
||||
"""Real sniffer against the actual host network stack."""
|
||||
|
||||
@@ -400,7 +396,6 @@ class TestSnifferLiveIsolation:
|
||||
|
||||
|
||||
@pytest.mark.live
|
||||
@pytest.mark.xdist_group("service_isolation_live")
|
||||
class TestApiLifespanLiveIsolation:
|
||||
"""Real API lifespan against real DB and real host state."""
|
||||
|
||||
@@ -447,7 +442,6 @@ class TestApiLifespanLiveIsolation:
|
||||
|
||||
|
||||
@pytest.mark.live
|
||||
@pytest.mark.xdist_group("service_isolation_live")
|
||||
class TestCascadeLiveIsolation:
|
||||
"""Verify that real component failures do not cascade."""
|
||||
|
||||
|
||||
Reference in New Issue
Block a user