imbajin commented on code in PR #823:
URL: 
https://github.com/apache/hugegraph-toolchain/pull/823#discussion_r4297560779


##########
hugegraph-hubble/hubble-dist/assembly/travis/run_live_hubble_smoke.py:
##########
@@ -593,6 +593,95 @@ def run_hubble_gremlin(hubble_url, graph_space, 
graph_name, content):
     ), f"Hubble Gremlin {content}")
 
 
+def run_hubble_cypher(hubble_url, graph_space, graph_name, content):
+    return unwrap(request(
+        "GET",
+        f"{hubble_url}/api/v1.3/graphspaces/{graph_space}/graphs/"
+        f"{graph_name}/cypher?{urllib.parse.urlencode({'cypher': content})}"
+    ), f"Hubble Cypher {content}")
+
+
+def check_cypher_graph_views(result, schema, prefix, kind):
+    resource = "vertices" if kind == "VERTEX" else "edges"
+    expected_count = 3 if kind == "VERTEX" else 2
+    expected_vertices = {f"{prefix}_{name}" for name in ("alice", "bob", 
"carol")}
+    expected_edges = {(f"{prefix}_alice", f"{prefix}_bob", schema["el_knows"]),
+                      (f"{prefix}_bob", f"{prefix}_carol", schema["el_knows"])}
+    if result.get("type") != kind:
+        raise RuntimeError(f"Cypher {resource} result type mismatch: {result}")
+    views = {"json": (result.get("json_view") or {}).get("data"),
+             "table": (result.get("table_view") or {}).get("rows"),
+             "graph": (result.get("graph_view") or {}).get(resource)}

Review Comment:
   Non-blocking test coverage suggestion: this only validates the primary 
resource in the graph view. At this head, both an EDGE result with expected 
edges but graph_view.vertices=[] and a VERTEX result with expected vertices but 
graph_view.edges=[] were independently accepted by check_cypher_graph_views. 
For this known healthy fixture, also consider checking the three endpoint 
vertices for the edge query and the two expected linked edges for the vertex 
query, with corresponding negative tests. This would catch broken graph 
enrichment while preserving QueryService's intentional best-effort production 
fallback. Evidence: bounded Python checks against this exact head, not a live 
Hubble/Server failure. [Reviewed 
source](https://github.com/apache/hugegraph-toolchain/blob/9abf29bf72f4a40b1c7e44b845c611652b50d8f3/hugegraph-hubble/hubble-dist/assembly/travis/run_live_hubble_smoke.py#L604-L635).



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to