Skip to content

Updating graph tests to support new execution plan #2486

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Dec 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 5 additions & 9 deletions tests/test_asyncio/test_graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ async def test_execution_plan(modclient: redis.Redis):
"MATCH (r:Rider)-[:rides]->(t:Team) WHERE t.name = $name RETURN r.name, t.name, $params", # noqa
{"name": "Yehuda"},
)
expected = "Results\n Project\n Conditional Traverse | (t:Team)->(r:Rider)\n Filter\n Node By Label Scan | (t:Team)" # noqa
expected = "Results\n Project\n Conditional Traverse | (t)->(r:Rider)\n Filter\n Node By Label Scan | (t:Team)" # noqa
assert result == expected

await redis_graph.delete()
Expand Down Expand Up @@ -437,11 +437,11 @@ async def test_explain(modclient: redis.Redis):
Distinct
Join
Project
Conditional Traverse | (t:Team)->(r:Rider)
Conditional Traverse | (t)->(r:Rider)
Filter
Node By Label Scan | (t:Team)
Project
Conditional Traverse | (t:Team)->(r:Rider)
Conditional Traverse | (t)->(r:Rider)
Filter
Node By Label Scan | (t:Team)"""
assert str(result).replace(" ", "").replace("\n", "") == expected.replace(
Expand All @@ -453,9 +453,7 @@ async def test_explain(modclient: redis.Redis):
Operation("Join")
.append_child(
Operation("Project").append_child(
Operation(
"Conditional Traverse", "(t:Team)->(r:Rider)"
).append_child(
Operation("Conditional Traverse", "(t)->(r:Rider)").append_child(
Operation("Filter").append_child(
Operation("Node By Label Scan", "(t:Team)")
)
Expand All @@ -464,9 +462,7 @@ async def test_explain(modclient: redis.Redis):
)
.append_child(
Operation("Project").append_child(
Operation(
"Conditional Traverse", "(t:Team)->(r:Rider)"
).append_child(
Operation("Conditional Traverse", "(t)->(r:Rider)").append_child(
Operation("Filter").append_child(
Operation("Node By Label Scan", "(t:Team)")
)
Expand Down
14 changes: 5 additions & 9 deletions tests/test_graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,7 @@ def test_execution_plan(client):
"MATCH (r:Rider)-[:rides]->(t:Team) WHERE t.name = $name RETURN r.name, t.name, $params", # noqa
{"name": "Yehuda"},
)
expected = "Results\n Project\n Conditional Traverse | (t:Team)->(r:Rider)\n Filter\n Node By Label Scan | (t:Team)" # noqa
expected = "Results\n Project\n Conditional Traverse | (t)->(r:Rider)\n Filter\n Node By Label Scan | (t:Team)" # noqa
assert result == expected

redis_graph.delete()
Expand Down Expand Up @@ -528,11 +528,11 @@ def test_explain(client):
Distinct
Join
Project
Conditional Traverse | (t:Team)->(r:Rider)
Conditional Traverse | (t)->(r:Rider)
Filter
Node By Label Scan | (t:Team)
Project
Conditional Traverse | (t:Team)->(r:Rider)
Conditional Traverse | (t)->(r:Rider)
Filter
Node By Label Scan | (t:Team)"""
assert str(result).replace(" ", "").replace("\n", "") == expected.replace(
Expand All @@ -544,9 +544,7 @@ def test_explain(client):
Operation("Join")
.append_child(
Operation("Project").append_child(
Operation(
"Conditional Traverse", "(t:Team)->(r:Rider)"
).append_child(
Operation("Conditional Traverse", "(t)->(r:Rider)").append_child(
Operation("Filter").append_child(
Operation("Node By Label Scan", "(t:Team)")
)
Expand All @@ -555,9 +553,7 @@ def test_explain(client):
)
.append_child(
Operation("Project").append_child(
Operation(
"Conditional Traverse", "(t:Team)->(r:Rider)"
).append_child(
Operation("Conditional Traverse", "(t)->(r:Rider)").append_child(
Operation("Filter").append_child(
Operation("Node By Label Scan", "(t:Team)")
)
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ volumes =

[docker:redismod]
name = redismod
image = redis/redis-stack-server:latest
image = redislabs/redismod:edge
ports =
36379:6379/tcp
healtcheck_cmd = python -c "import socket;print(True) if 0 == socket.socket(socket.AF_INET, socket.SOCK_STREAM).connect_ex(('127.0.0.1',36379)) else False"
Expand Down