Skip to content

Commit

Permalink
Add redict to CI
Browse files Browse the repository at this point in the history
  • Loading branch information
alisaifee committed Apr 21, 2024
1 parent e52c396 commit 08bc194
Show file tree
Hide file tree
Showing 16 changed files with 60 additions and 14 deletions.
18 changes: 9 additions & 9 deletions .github/workflows/compatibility.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ jobs:
matrix:
python-version: [3.8, 3.9, "3.10", "3.11", "3.12"]
redis-version: ["6.2", "7.0", "7.2", "latest"]
test_params: ["-m '(not (keydb or dragonfly or valkey))'"]
test_params: ["-m '(not (keydb or dragonfly or valkey or redict))'"]
orjson: ["False"]
uvloop: ["True", "False"]
runtime_type_checks: ["True"]
Expand All @@ -72,24 +72,24 @@ jobs:
include:
- python-version: "3.11"
redis-version: next
test_params: "-m '(not (keydb or dragonfly or valkey))'"
test_params: "-m '(not (keydb or dragonfly or valkey or redict))'"
runtime_type_checks: "True"
label: ""
- python-version: "3.11"
redis-version: latest
test_params: "-m '(not (keydb or dragonfly or valkey))'"
test_params: "-m '(not (keydb or dragonfly or valkey or redict))'"
extensions: "False"
runtime_type_checks: "True"
label: ""
- python-version: "3.11"
redis-version: latest
test_params: "-m '(not (keydb or dragonfly or valkey))'"
test_params: "-m '(not (keydb or dragonfly or valkey or redict))'"
runtime_type_checks: "True"
orjson: "True"
label: ""
- python-version: "3.11"
redis-version: 7.0
test_params: "-m '(not (keydb or dragonfly or valkey))'"
test_params: "-m '(not (keydb or dragonfly or valkey or redict))'"
runtime_type_checks: "False"
label: ""
- python-version: "3.11"
Expand All @@ -103,18 +103,18 @@ jobs:
label: "Dragonfly"
- python-version: "3.11"
redis-version: 7.0
test_params: "-m valkey"
label: "Valkey"
test_params: "-m valkey or redict"
label: "valkey or redict"
- python-version: "pypy-3.8"
redis-version: 7.0
test_params: "-m '(not (keydb or dragonfly or valkey))' tests/commands tests/test_tracking_cache.py"
test_params: "-m '(not (keydb or dragonfly or valkey or redict))' tests/commands tests/test_tracking_cache.py"
runtime_type_checks: "False"
extensions: "False"
uvloop: "False"
label: ""
- python-version: "pypy-3.9"
redis-version: 7.0
test_params: "-m '(not (keydb or dragonfly or valkey))' tests/commands tests/test_tracking_cache.py"
test_params: "-m '(not (keydb or dragonfly or valkey or redict))' tests/commands tests/test_tracking_cache.py"
runtime_type_checks: "False"
extensions: "False"
uvloop: "False"
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ jobs:
matrix:
python-version: ["3.10", "3.11", "3.12"]
redis-version: ["6.2", "7.0", "7.2", "latest"]
test_params: ["-m '(not (keydb or dragonfly or valkey))'"]
test_params: ["-m '(not (keydb or dragonfly or valkey or redict))'"]
uvloop: ["True", "False"]
orjson: ["False"]
runtime_type_checks: ["True"]
Expand All @@ -66,7 +66,7 @@ jobs:
include:
- python-version: "3.11"
redis-version: "latest"
test_params: "-m '(not (keydb or dragonfly or valkey))'"
test_params: "-m '(not (keydb or dragonfly or valkey or redict))'"
runtime_type_checks: "True"
extensions: "False"
- python-version: "3.11"
Expand All @@ -79,11 +79,11 @@ jobs:
label: "Dragonfly"
- python-version: "3.11"
redis-version: "7.0"
test_params: "-m valkey"
label: "Valkey"
test_params: "-m valkey or redict"
label: "valkey or redict"
- python-version: "pypy-3.9"
redis-version: "7.0"
test_params: "-m '(not (keydb or dragonfly or valkey))' tests/commands tests/test_tracking_cache.py"
test_params: "-m '(not (keydb or dragonfly or valkey or redict))' tests/commands tests/test_tracking_cache.py"
runtime_type_checks: "False"
extensions: "False"
uvloop: "False"
Expand Down
4 changes: 4 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -324,3 +324,7 @@ services:
image: "valkey/valkey:${VALKEY_VERSION:-unstable}"
ports:
- '12379:6379'
redict:
image: "registry.redict.io/redict:${REDICT_VERSION:-latest}"
ports:
- '13379:6379'
1 change: 1 addition & 0 deletions pytest.ini
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ markers =
sentinel
stack
valkey
redict
ssl
uds
nocluster
Expand Down
1 change: 1 addition & 0 deletions tests/commands/test_acl.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ async def teardown(client):
"redis_cluster_raw",
"keydb",
"valkey",
"redict",
)
@pytest.mark.min_server_version("6.0.0")
class TestACL:
Expand Down
1 change: 1 addition & 0 deletions tests/commands/test_bitmap.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"redis_cluster_raw",
"keydb",
"valkey",
"redict",
)
class TestBitmap:
async def test_bitcount(self, client, _s):
Expand Down
1 change: 1 addition & 0 deletions tests/commands/test_generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"redis_cluster_cached",
"keydb",
"valkey",
"redict",
)
class TestGeneric:
async def test_sort_basic(self, client, _s):
Expand Down
1 change: 1 addition & 0 deletions tests/commands/test_geo.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"redis_cluster_raw",
"keydb",
"valkey",
"redict",
)
class TestGeo:
async def test_geoadd(self, client, _s):
Expand Down
1 change: 1 addition & 0 deletions tests/commands/test_hash.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"keydb",
"dragonfly",
"valkey",
"redict",
)
class TestHash:
async def test_hget_and_hset(self, client, _s):
Expand Down
1 change: 1 addition & 0 deletions tests/commands/test_hyperloglog.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"redis_cluster_raw",
"keydb",
"valkey",
"redict",
)
class TestHyperLogLog:
async def test_pfadd(self, client, _s):
Expand Down
1 change: 1 addition & 0 deletions tests/commands/test_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"keydb",
"dragonfly",
"valkey",
"redict",
)
class TestList:
async def test_blpop(self, client, _s):
Expand Down
1 change: 1 addition & 0 deletions tests/commands/test_set.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"keydb",
"dragonfly",
"valkey",
"redict",
)
class TestSet:
async def test_sadd(self, client, _s):
Expand Down
1 change: 1 addition & 0 deletions tests/commands/test_sorted_set.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"keydb",
"dragonfly",
"valkey",
"redict",
)
class TestSortedSet:
async def test_zadd(self, client, _s):
Expand Down
1 change: 1 addition & 0 deletions tests/commands/test_streams.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ async def get_stream_message(client, stream, message_id):
"redis_cluster_raw",
"keydb",
"valkey",
"redict",
)
class TestStreams:
async def test_xadd_with_wrong_id(self, client, _s):
Expand Down
1 change: 1 addition & 0 deletions tests/commands/test_string.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"keydb_resp2",
"dragonfly",
"valkey",
"redict",
)
class TestString:
async def test_append(self, client, _s):
Expand Down
30 changes: 30 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -485,6 +485,13 @@ def valkey_server(docker_services):
yield ["localhost", 12379]


@pytest.fixture(scope="session")
def redict_server(docker_services):
docker_services.start("redict")
docker_services.wait_for_service("redict", 6379, ping_socket)
yield ["localhost", 13379]


@pytest.fixture(scope="session")
def keydb_cluster_server(docker_services):
docker_services.start("keydb-cluster-init")
Expand Down Expand Up @@ -1234,6 +1241,23 @@ async def valkey(valkey_server, request):
client.connection_pool.disconnect()


@pytest.fixture
async def redict(redict_server, request):
client = coredis.Redis(
"localhost",
13379,
decode_responses=True,
**get_client_test_args(request),
)
await client.flushall()
await check_test_constraints(request, client)
await set_default_test_config(client, variant="redict")

yield client

client.connection_pool.disconnect()


@pytest.fixture(scope="session")
def docker_services_project_name():
return "coredis"
Expand Down Expand Up @@ -1363,5 +1387,11 @@ def pytest_collection_modifyitems(items):
item.add_marker(getattr(pytest.mark, "valkey"))
tokens = client_name.replace("valkey_", "").split("_")

for token in tokens:
item.add_marker(getattr(pytest.mark, token))
elif client_name.startswith("redict"):
item.add_marker(getattr(pytest.mark, "redict"))
tokens = client_name.replace("redict_", "").split("_")

for token in tokens:
item.add_marker(getattr(pytest.mark, token))

0 comments on commit 08bc194

Please sign in to comment.