Skip to content

Commit 9bec5ba

Browse files
committed
feat: cover diagnostic and test-support APIs
1 parent 715b7be commit 9bec5ba

2 files changed

Lines changed: 52 additions & 0 deletions

File tree

platform-api/src/openmetadata_demo_api/catalog.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,7 @@
184184
"usage/UsageResource.java",
185185
"version/VersionResource.java",
186186
}
187+
NON_PUBLIC_VISIBILITIES = {"hidden", "internal", "diagnostic", "test-support"}
187188
CORE_SERVICE_PREREQUISITES = {
188189
"createApiService",
189190
"createDashboardService",
@@ -665,6 +666,15 @@ def scenarios() -> dict[str, Scenario]:
665666
if operation["source"]["file"] in PLATFORM_SYSTEM_FILES
666667
),
667668
),
669+
"diagnostic-test-support": scenario_from_operations(
670+
"diagnostic-test-support",
671+
"Unsupported hidden, internal, diagnostic, and test-support source routes",
672+
tuple(
673+
operation
674+
for operation in all_operations
675+
if operation["visibility"] in NON_PUBLIC_VISIBILITIES
676+
),
677+
),
668678
}
669679

670680

platform-api/tests/test_runtime.py

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1534,3 +1534,45 @@ def test_platform_system_requests_are_validated_and_placeholder_free() -> None:
15341534
if not step.barrier and step.request["method"] != "DELETE"
15351535
]
15361536
assert max(non_delete_positions) < min(delete_positions)
1537+
1538+
1539+
def test_diagnostic_support_scenario_covers_every_non_public_route() -> None:
1540+
non_public = {"hidden", "internal", "diagnostic", "test-support"}
1541+
expected = {
1542+
operation["operation_id"]
1543+
for operation in load_operations()
1544+
if operation["visibility"] in non_public
1545+
}
1546+
1547+
scenario = scenarios()["diagnostic-test-support"]
1548+
1549+
assert {step.operation_id for step in scenario.operation_steps} == expected
1550+
assert len(scenario.run()) == len(expected)
1551+
assert {
1552+
operation["visibility"]
1553+
for operation in load_operations()
1554+
if operation["operation_id"] in expected
1555+
} == non_public
1556+
assert {
1557+
"getSystemDiagnostics",
1558+
"IndexResource.getIndex",
1559+
"testSupportSearchCount",
1560+
"searchEntitiesWithQuery",
1561+
"listSettings",
1562+
} <= expected
1563+
1564+
1565+
def test_diagnostic_support_requests_are_offline_and_placeholder_free() -> None:
1566+
scenario = scenarios()["diagnostic-test-support"]
1567+
1568+
assert "unsupported" in scenario.description.lower()
1569+
assert not {
1570+
str(value["_model"])
1571+
for step in scenario.operation_steps
1572+
for value in _nested_mappings(step.request)
1573+
if "_model" in value
1574+
}
1575+
assert all(
1576+
str(step.request["path"]).startswith("/") and "://" not in str(step.request["path"])
1577+
for step in scenario.operation_steps
1578+
)

0 commit comments

Comments
 (0)