commit:     099d64b1742cb3ee91fe38ee075e9ef3ec1b88c3
Author:     Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
AuthorDate: Tue Dec  6 16:12:34 2022 +0000
Commit:     Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
CommitDate: Tue Dec  6 16:12:55 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=099d64b1

dev-python/redis-py: enable testing with redis-7

Signed-off-by: Arthur Zamarin <arthurzam <AT> gentoo.org>

 dev-python/redis-py/redis-py-4.4.0.ebuild | 17 ++++++++++++-----
 1 file changed, 12 insertions(+), 5 deletions(-)

diff --git a/dev-python/redis-py/redis-py-4.4.0.ebuild 
b/dev-python/redis-py/redis-py-4.4.0.ebuild
index 928539d1ddbb..39794f5a9cfe 100644
--- a/dev-python/redis-py/redis-py-4.4.0.ebuild
+++ b/dev-python/redis-py/redis-py-4.4.0.ebuild
@@ -27,7 +27,7 @@ RDEPEND="
 "
 BDEPEND="
        test? (
-               <dev-db/redis-7
+               dev-db/redis
                dev-python/pytest-asyncio[${PYTHON_USEDEP}]
                dev-python/pytest-timeout[${PYTHON_USEDEP}]
        )
@@ -41,6 +41,8 @@ python_test() {
                tests/test_pubsub.py::TestPubSubDeadlock::test_pubsub_deadlock
                # TODO
                tests/test_commands.py::TestRedisCommands::test_acl_list
+               # redis-7 different return
+               tests/test_commands.py::TestRedisCommands::test_xautoclaim
        )
 
        # TODO: try to run more servers?
@@ -51,17 +53,22 @@ src_test() {
        local redis_pid="${T}"/redis.pid
        local redis_port=6379
 
+       if has_version ">=dev-db/redis-7"; then
+               local extra_conf="
+                       enable-debug-command yes
+                       enable-module-command yes
+               "
+       fi
+
        # Spawn Redis itself for testing purposes
-       # NOTE: On sam@'s machine, spawning Redis can hang in the sandbox.
-       # I'm not restricting tests yet because this doesn't happen for anyone 
else AFAICT.
        einfo "Spawning Redis"
        einfo "NOTE: Port ${redis_port} must be free"
-       # "${EPREFIX}"/usr/sbin/redis-server - <<< "${redis_test_config}" || die
        "${EPREFIX}"/usr/sbin/redis-server - <<- EOF || die "Unable to start 
redis server"
                daemonize yes
                pidfile ${redis_pid}
                port ${redis_port}
-               bind 127.0.0.1
+               bind 127.0.0.1 ::1
+               ${extra_conf}
        EOF
 
        # Run the tests

Reply via email to