fix(test-runner): revert response envelope to flat shape

This commit is contained in:
DumiFlex
2026-04-28 13:31:01 +03:00
parent 0f6fe72182
commit 1479d57817
3 changed files with 11 additions and 15 deletions
+5 -7
View File
@@ -13,10 +13,9 @@ async def test_run_wildcard(wp_client):
})
assert resp.status == 200
body = await resp.json()
data = body["data"]
assert len(data["results"]) == 5
assert all(r == {"$x": "alpha"} for r in data["results"])
assert data["histogram"] == {"alpha": 5}
assert len(body["results"]) == 5
assert all(r == {"$x": "alpha"} for r in body["results"])
assert body["histogram"] == {"alpha": 5}
async def test_run_fixed_values(wp_client):
@@ -28,9 +27,8 @@ async def test_run_fixed_values(wp_client):
})
assert resp.status == 200
body = await resp.json()
data = body["data"]
assert data["results"][0] == {"$lens": "85mm"}
assert data["histogram"] == {"85mm": 1}
assert body["results"][0] == {"$lens": "85mm"}
assert body["histogram"] == {"85mm": 1}
async def test_run_unknown_type_400(wp_client):
+2 -2
View File
@@ -62,7 +62,7 @@ async def test_nested_wildcard_ref_resolves_via_catalog(aiohttp_client, app_with
})
assert resp.status == 200
body = await resp.json()
samples = body["data"]["samples"]
samples = body["samples"]
assert len(samples) == 5
for s in samples:
assert s in ("red dress", "blue dress"), (
@@ -86,7 +86,7 @@ async def test_unknown_ref_emits_warning_does_not_crash(aiohttp_client, app_with
})
assert resp.status == 200
body = await resp.json()
warnings = body["data"].get("warnings", [])
warnings = body.get("warnings", [])
assert any("deadbeef" in str(w) for w in warnings), (
f"expected 'Unknown wildcard ref' warning for deadbeef, got: {warnings}"
)
+4 -6
View File
@@ -103,12 +103,10 @@ async def run_test(request: web.Request) -> web.Response:
sample_values.append("")
return json_ok({
"data": {
"samples": sample_values,
"warnings": deduped_warnings,
"histogram": dict(histogram),
"results": results,
},
"results": results,
"histogram": dict(histogram),
"samples": sample_values, # NEW: additive top-level
"warnings": deduped_warnings, # NEW: additive top-level
})