Commit b2f32756 authored by George Papathanail's avatar George Papathanail
Browse files

test: suppress filter_too_much for EAM POST /apps

parent ed1442a1
Loading
Loading
Loading
Loading
Loading
+9 −4
Changes for tests/conformance/test_eam_conformance.py: 9 added lines, 4 removed lines.
Original line number Diff line number Diff line
@@ -14,6 +14,7 @@ import pytest
import schemathesis
import yaml
from fastapi.testclient import TestClient
from hypothesis import HealthCheck, settings

from open_exposure_gateway.api.camara.edge_application_management.v0_1_0_alpha_1.router import (
    BASE_PATH,
@@ -42,10 +43,9 @@ STUBBED = {
    ("GET", "/clusters"),
}

# componentSpec x networkInterfaces allows 100x100 items, so generated AppManifest bodies
# routinely overrun Hypothesis's size budget and POST /apps fails its filter_too_much
# health check. Capping both arrays in memory (the vendored spec is untouched) keeps the
# health check enabled; 5 was already reliable, 3 leaves margin.
# componentSpec x networkInterfaces allows 100x100 items, so uncapped AppManifest bodies
# overrun Hypothesis's size budget. Capping both arrays in memory (the vendored spec is
# untouched) keeps POST /apps bodies generatable.
raw_spec = yaml.safe_load(SPEC.read_text())
component_spec = raw_spec["components"]["schemas"]["AppManifest"]["properties"]["componentSpec"]
component_spec["maxItems"] = 3
@@ -71,7 +71,12 @@ schema.config.checks.positive_data_acceptance.expected_statuses = [
]


# Even capped, POST /apps discards ~80% of draws (unique object keys in the nested oneOf
# AppManifest, and negative-mode mutations that stay valid), so Hypothesis's
# filter_too_much health check fails intermittently. That measures generator efficiency,
# not API conformance.
@schema.parametrize()
@settings(suppress_health_check=[HealthCheck.filter_too_much])
def test_eam_conformance(case: "OpenApiCase") -> None:
    case.call_and_validate()