Skip to content

Commit

Permalink
fix(interactive): Fix robust test (#4193)
Browse files Browse the repository at this point in the history
Fix the bug in robust test. Related issue:
#4192
  • Loading branch information
zhanglei1949 authored Aug 29, 2024
1 parent eb848a5 commit 2d3268e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
4 changes: 2 additions & 2 deletions flex/interactive/sdk/python/gs_interactive/client/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -616,7 +616,7 @@ def call_procedure_raw(self, graph_id: StrictStr, params: bytes) -> Result[str]:
# Here we add byte of value 1 to denote the input format is in encoder/decoder format
response = self._query_api.call_proc_with_http_info(
graph_id = graph_id,
body = append_format_byte(params.encode(), InputFormat.CPP_ENCODER)
body = append_format_byte(params, InputFormat.CPP_ENCODER)
)
return Result.from_response(response)
except Exception as e:
Expand All @@ -627,7 +627,7 @@ def call_procedure_current_raw(self, params: bytes) -> Result[str]:
# gs_interactive currently support four type of inputformat, see flex/engines/graph_db/graph_db_session.h
# Here we add byte of value 1 to denote the input format is in encoder/decoder format
response = self._query_api.call_proc_current_with_http_info(
body = append_format_byte(params.encode(), InputFormat.CPP_ENCODER)
body = append_format_byte(params, InputFormat.CPP_ENCODER)
)
return Result.from_response(response)
except Exception as e:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,6 @@ def import_data_to_full_modern_graph(sess: Session, graph_id: str):
assert wait_job_finish(sess, job_id)

def submit_query_via_neo4j_endpoint(neo4j_sess : Neo4jSession, graph_id: str, query: str):
query = "MATCH(n) return n"
result = neo4j_sess.run(query)
#check have 1 records, result 0
result_cnt = 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,15 @@
from gs_interactive.tests.conftest import import_data_to_vertex_only_modern_graph, import_data_to_partial_modern_graph, import_data_to_full_modern_graph


cypher_queries = [
vertex_only_cypher_queries = [
"MATCH(n) return count(n)",
"MATCH(n) return n",
"MATCH(n) return n limit 10",
"MATCH()-[r]->() return count(r)",
]

# extend the query list to include queries that are not supported by vertex-only graph
cypher_queries = vertex_only_cypher_queries + [
#"MATCH()-[e]->() return count(e)", # currently not supported by compiler+ffi, see https://github.com/alibaba/GraphScope/issues/4192
"MATCH(a)-[b]->(c) return count(b)",
"MATCH(a)-[b]->(c) return b",
"MATCH(a)-[b]->(c) return c.id",
Expand All @@ -48,11 +52,11 @@ def test_query_on_vertex_only_graph(interactive_session, neo4j_session, create_v
"""
print("[Query on vertex only graph]")
start_service_on_graph(interactive_session, create_vertex_only_modern_graph)
run_cypher_test_suite(neo4j_session, create_vertex_only_modern_graph, cypher_queries)
run_cypher_test_suite(neo4j_session, create_vertex_only_modern_graph, vertex_only_cypher_queries)

start_service_on_graph(interactive_session,"1")
import_data_to_vertex_only_modern_graph(interactive_session, create_vertex_only_modern_graph)
run_cypher_test_suite(neo4j_session, create_vertex_only_modern_graph, cypher_queries)
run_cypher_test_suite(neo4j_session, create_vertex_only_modern_graph, vertex_only_cypher_queries)

def test_query_on_partial_graph(interactive_session,neo4j_session, create_partial_modern_graph):
"""
Expand Down

0 comments on commit 2d3268e

Please sign in to comment.