Skip to content
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

Re-enable Graph tests #3287

Merged
merged 6 commits into from
Jun 20, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
3 changes: 2 additions & 1 deletion .github/workflows/integration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,9 @@ permissions:
contents: read # to fetch code (actions/checkout)

env:
REDIS_STACK_IMAGE: redis/redis-stack-server:7.4.0-rc1
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
REDIS_IMAGE: redis/redis-stack-server:7.4.0-rc1
REDIS_STACK_IMAGE: redis/redis-stack-server:7.4.0-rc1

jobs:
dependency-audit:
Expand Down
19 changes: 14 additions & 5 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ services:
redis:
image: ${REDIS_IMAGE:-redis:latest}
container_name: redis-standalone
command: redis-server --enable-debug-command yes
command: redis-server --enable-debug-command yes --protected-mode no
ports:
- 6379:6379
profiles:
Expand All @@ -21,7 +21,7 @@ services:
container_name: redis-replica
depends_on:
- redis
command: redis-server --replicaof redis 6379
command: redis-server --replicaof redis 6379 --protected-mode no
ports:
- 6380:6379
profiles:
Expand Down Expand Up @@ -67,7 +67,7 @@ services:
container_name: redis-sentinel
depends_on:
- redis
entrypoint: "/usr/local/bin/redis-sentinel /redis.conf --port 26379"
entrypoint: "redis-sentinel /redis.conf --port 26379"
ports:
- 26379:26379
volumes:
Expand All @@ -81,7 +81,7 @@ services:
container_name: redis-sentinel2
depends_on:
- redis
entrypoint: "/usr/local/bin/redis-sentinel /redis.conf --port 26380"
entrypoint: "redis-sentinel /redis.conf --port 26380"
ports:
- 26380:26380
volumes:
Expand All @@ -95,7 +95,7 @@ services:
container_name: redis-sentinel3
depends_on:
- redis
entrypoint: "/usr/local/bin/redis-sentinel /redis.conf --port 26381"
entrypoint: "redis-sentinel /redis.conf --port 26381"
ports:
- 26381:26381
volumes:
Expand All @@ -114,3 +114,12 @@ services:
profiles:
- standalone
- all

redis-stack-graph:
image: redis/redis-stack-server:6.2.6-v15
container_name: redis-stack-graph
ports:
- 6480:6379
profiles:
- standalone
- all
6 changes: 3 additions & 3 deletions dockers/create_cluster.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ dir /nodes/$PORT
EOF

set -x
/usr/local/bin/redis-server /nodes/$PORT/redis.conf
redis-server /nodes/$PORT/redis.conf
sleep 1
if [ $? -ne 0 ]; then
echo "Redis failed to start, exiting."
Expand All @@ -40,8 +40,8 @@ EOF
echo 127.0.0.1:$PORT >> /nodes/nodemap
done
if [ -z "${REDIS_PASSWORD}" ]; then
echo yes | /usr/local/bin/redis-cli --cluster create `seq -f 127.0.0.1:%g ${START_PORT} ${END_PORT}` --cluster-replicas 1
echo yes | redis-cli --cluster create `seq -f 127.0.0.1:%g ${START_PORT} ${END_PORT}` --cluster-replicas 1
else
echo yes | /usr/local/bin/redis-cli -a ${REDIS_PASSWORD} --cluster create `seq -f 127.0.0.1:%g ${START_PORT} ${END_PORT}` --cluster-replicas 1
echo yes | redis-cli -a ${REDIS_PASSWORD} --cluster create `seq -f 127.0.0.1:%g ${START_PORT} ${END_PORT}` --cluster-replicas 1
fi
tail -f /redis.log
21 changes: 1 addition & 20 deletions tests/test_asyncio/test_graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

@pytest_asyncio.fixture()
async def decoded_r(create_redis, stack_url):
return await create_redis(decode_responses=True, url=stack_url)
return await create_redis(decode_responses=True, url="redis://localhost:6480")


@pytest.mark.redismod
Expand All @@ -20,7 +20,6 @@ async def test_bulk(decoded_r):


@pytest.mark.redismod
@pytest.mark.skip(reason="Graph module removed from Redis Stack")
async def test_graph_creation(decoded_r: redis.Redis):
graph = decoded_r.graph()

Expand Down Expand Up @@ -66,7 +65,6 @@ async def test_graph_creation(decoded_r: redis.Redis):


@pytest.mark.redismod
@pytest.mark.skip(reason="Graph module removed from Redis Stack")
async def test_array_functions(decoded_r: redis.Redis):
graph = decoded_r.graph()

Expand All @@ -90,7 +88,6 @@ async def test_array_functions(decoded_r: redis.Redis):


@pytest.mark.redismod
@pytest.mark.skip(reason="Graph module removed from Redis Stack")
async def test_path(decoded_r: redis.Redis):
node0 = Node(node_id=0, label="L1")
node1 = Node(node_id=1, label="L1")
Expand All @@ -111,7 +108,6 @@ async def test_path(decoded_r: redis.Redis):


@pytest.mark.redismod
@pytest.mark.skip(reason="Graph module removed from Redis Stack")
async def test_param(decoded_r: redis.Redis):
params = [1, 2.3, "str", True, False, None, [0, 1, 2]]
query = "RETURN $param"
Expand All @@ -122,7 +118,6 @@ async def test_param(decoded_r: redis.Redis):


@pytest.mark.redismod
@pytest.mark.skip(reason="Graph module removed from Redis Stack")
async def test_map(decoded_r: redis.Redis):
query = "RETURN {a:1, b:'str', c:NULL, d:[1,2,3], e:True, f:{x:1, y:2}}"

Expand All @@ -140,7 +135,6 @@ async def test_map(decoded_r: redis.Redis):


@pytest.mark.redismod
@pytest.mark.skip(reason="Graph module removed from Redis Stack")
async def test_point(decoded_r: redis.Redis):
query = "RETURN point({latitude: 32.070794860, longitude: 34.820751118})"
expected_lat = 32.070794860
Expand All @@ -158,7 +152,6 @@ async def test_point(decoded_r: redis.Redis):


@pytest.mark.redismod
@pytest.mark.skip(reason="Graph module removed from Redis Stack")
async def test_index_response(decoded_r: redis.Redis):
result_set = await decoded_r.graph().query("CREATE INDEX ON :person(age)")
assert 1 == result_set.indices_created
Expand All @@ -174,7 +167,6 @@ async def test_index_response(decoded_r: redis.Redis):


@pytest.mark.redismod
@pytest.mark.skip(reason="Graph module removed from Redis Stack")
async def test_stringify_query_result(decoded_r: redis.Redis):
graph = decoded_r.graph()

Expand Down Expand Up @@ -229,7 +221,6 @@ async def test_stringify_query_result(decoded_r: redis.Redis):


@pytest.mark.redismod
@pytest.mark.skip(reason="Graph module removed from Redis Stack")
async def test_optional_match(decoded_r: redis.Redis):
# Build a graph of form (a)-[R]->(b)
node0 = Node(node_id=0, label="L1", properties={"value": "a"})
Expand All @@ -255,7 +246,6 @@ async def test_optional_match(decoded_r: redis.Redis):


@pytest.mark.redismod
@pytest.mark.skip(reason="Graph module removed from Redis Stack")
async def test_cached_execution(decoded_r: redis.Redis):
await decoded_r.graph().query("CREATE ()")

Expand All @@ -276,7 +266,6 @@ async def test_cached_execution(decoded_r: redis.Redis):


@pytest.mark.redismod
@pytest.mark.skip(reason="Graph module removed from Redis Stack")
async def test_slowlog(decoded_r: redis.Redis):
create_query = """CREATE
(:Rider {name:'Valentino Rossi'})-[:rides]->(:Team {name:'Yamaha'}),
Expand All @@ -291,7 +280,6 @@ async def test_slowlog(decoded_r: redis.Redis):

@pytest.mark.xfail(strict=False)
@pytest.mark.redismod
@pytest.mark.skip(reason="Graph module removed from Redis Stack")
async def test_query_timeout(decoded_r: redis.Redis):
# Build a sample graph with 1000 nodes.
await decoded_r.graph().query("UNWIND range(0,1000) as val CREATE ({v: val})")
Expand All @@ -306,7 +294,6 @@ async def test_query_timeout(decoded_r: redis.Redis):


@pytest.mark.redismod
@pytest.mark.skip(reason="Graph module removed from Redis Stack")
async def test_read_only_query(decoded_r: redis.Redis):
with pytest.raises(Exception):
# Issue a write query, specifying read-only true,
Expand All @@ -316,7 +303,6 @@ async def test_read_only_query(decoded_r: redis.Redis):


@pytest.mark.redismod
@pytest.mark.skip(reason="Graph module removed from Redis Stack")
async def test_profile(decoded_r: redis.Redis):
q = """UNWIND range(1, 3) AS x CREATE (p:Person {v:x})"""
profile = (await decoded_r.graph().profile(q)).result_set
Expand All @@ -333,7 +319,6 @@ async def test_profile(decoded_r: redis.Redis):

@skip_if_redis_enterprise()
@pytest.mark.redismod
@pytest.mark.skip(reason="Graph module removed from Redis Stack")
async def test_config(decoded_r: redis.Redis):
config_name = "RESULTSET_SIZE"
config_value = 3
Expand Down Expand Up @@ -366,7 +351,6 @@ async def test_config(decoded_r: redis.Redis):

@pytest.mark.onlynoncluster
@pytest.mark.redismod
@pytest.mark.skip(reason="Graph module removed from Redis Stack")
async def test_list_keys(decoded_r: redis.Redis):
result = await decoded_r.graph().list_keys()
assert result == []
Expand All @@ -390,7 +374,6 @@ async def test_list_keys(decoded_r: redis.Redis):


@pytest.mark.redismod
@pytest.mark.skip(reason="Graph module removed from Redis Stack")
async def test_multi_label(decoded_r: redis.Redis):
redis_graph = decoded_r.graph("g")

Expand All @@ -417,7 +400,6 @@ async def test_multi_label(decoded_r: redis.Redis):


@pytest.mark.redismod
@pytest.mark.skip(reason="Graph module removed from Redis Stack")
async def test_execution_plan(decoded_r: redis.Redis):
redis_graph = decoded_r.graph("execution_plan")
create_query = """CREATE
Expand All @@ -437,7 +419,6 @@ async def test_execution_plan(decoded_r: redis.Redis):


@pytest.mark.redismod
@pytest.mark.skip(reason="Graph module removed from Redis Stack")
async def test_explain(decoded_r: redis.Redis):
redis_graph = decoded_r.graph("execution_plan")
# graph creation / population
Expand Down
Loading
Loading