feat: qualify complete RELLIS ground dataset
This commit is contained in:
@@ -435,6 +435,44 @@ def test_polygon_api_rejects_tampered_review_frame(tmp_path: Path) -> None:
|
||||
assert "SHA-256" in failure.value.detail or "файл" in failure.value.detail.lower()
|
||||
|
||||
|
||||
def test_polygon_api_publishes_rellis_sequence_identity(tmp_path: Path) -> None:
|
||||
root = tmp_path / "runs"
|
||||
run, _ = _qualification_run(root)
|
||||
frame_id = "rellis-00000-000307"
|
||||
frame_path = _review_pack(root, run.run_id, frame_id)
|
||||
with np.load(frame_path, allow_pickle=False) as source:
|
||||
payload = {key: source[key] for key in source.files}
|
||||
payload["schema"] = np.asarray(["missioncore.rellis-ground-review-frame/v1"])
|
||||
np.savez_compressed(frame_path, **payload)
|
||||
manifest_path = frame_path.parent.parent / "manifest.json"
|
||||
manifest = json.loads(manifest_path.read_text(encoding="utf-8"))
|
||||
manifest["schema_version"] = "missioncore.rellis-ground-review-pack/v1"
|
||||
manifest["source_id"] = "rellis-3d/v1.1"
|
||||
manifest["frames"][0]["dataset_sequence_id"] = "00000"
|
||||
manifest["frames"][0]["dataset_frame_number"] = 307
|
||||
manifest["frames"][0]["sha256"] = hashlib.sha256(frame_path.read_bytes()).hexdigest()
|
||||
manifest["frames"][0]["byte_length"] = frame_path.stat().st_size
|
||||
manifest_path.write_text(json.dumps(manifest), encoding="utf-8")
|
||||
router = build_polygon_router(root_provider=lambda: root)
|
||||
|
||||
review = _endpoint(
|
||||
router,
|
||||
"/api/v1/polygon/runs/{run_id}/qualification/review",
|
||||
"GET",
|
||||
)(run_id=run.run_id)
|
||||
frame = _endpoint(
|
||||
router,
|
||||
"/api/v1/polygon/runs/{run_id}/qualification/review/frames/{frame_id}",
|
||||
"GET",
|
||||
)(run_id=run.run_id, frame_id=frame_id)
|
||||
|
||||
assert review["source_id"] == "rellis-3d/v1.1"
|
||||
assert review["frames"][0]["dataset_sequence_id"] == "00000"
|
||||
assert review["frames"][0]["dataset_frame_number"] == 307
|
||||
assert review["frames"][0]["sensor_timestamp_ns"] is None
|
||||
assert frame["frame_id"] == frame_id
|
||||
|
||||
|
||||
class _FakeWorkerGateway:
|
||||
def __init__(self) -> None:
|
||||
self.calls: list[tuple[str, str]] = []
|
||||
|
||||
Reference in New Issue
Block a user