feat(test): add test-schema target and SCHEMA_QUICK=1 mode for schemathesis
- Add dedicated test-schema Makefile target (xdist logical, 600s timeout, -m fuzz) so schemathesis runs separately from test-fuzz, which was spinning up competing uvicorn workers per xdist process - Exclude all test_schemathesis*.py files from FUZZ_FLAGS via --ignore - Add schema to _ALL_SUITES between api and fuzz - Add SCHEMA_QUICK env var (default 0): caps every max_examples to 100 across all four schemathesis files (4520 -> 600 total examples) - Fix pre-push hook: use .311 venv and delegate to make test-all FAIL_FAST=0 instead of hand-rolling five separate pytest invocations
This commit is contained in:
@@ -40,6 +40,7 @@ def _free_port() -> int:
|
||||
LIVE_PORT = _free_port()
|
||||
LIVE_SERVER_URL = f"http://127.0.0.1:{LIVE_PORT}"
|
||||
TEST_SECRET = "test-secret-for-automated-fuzzing"
|
||||
_QUICK = os.getenv("SCHEMA_QUICK") == "1"
|
||||
|
||||
import decnet.web.auth
|
||||
decnet.web.auth.SECRET_KEY = TEST_SECRET
|
||||
@@ -144,7 +145,7 @@ schema = st.openapi.from_url(f"{LIVE_SERVER_URL}/openapi.json")
|
||||
@pytest.mark.fuzz
|
||||
@st.pytest.parametrize(api=schema)
|
||||
@settings(
|
||||
max_examples=3000,
|
||||
max_examples=100 if _QUICK else 3000,
|
||||
deadline=None,
|
||||
verbosity=Verbosity.debug,
|
||||
suppress_health_check=[
|
||||
@@ -161,7 +162,7 @@ def test_schema_compliance(case):
|
||||
@pytest.mark.fuzz
|
||||
@st.pytest.parametrize(api=schema)
|
||||
@settings(
|
||||
max_examples=500,
|
||||
max_examples=100 if _QUICK else 500,
|
||||
deadline=None,
|
||||
verbosity=Verbosity.normal,
|
||||
suppress_health_check=[
|
||||
|
||||
Reference in New Issue
Block a user