14
0
forked from pool/python-redis

Accepting request 1315971 from devel:languages:python

Forwarded request #1315726 from ateixeira

- Rewrite logic for skipping tests
    * Add skipped_tests
    * Move list of skipped tests from spec to skipped_tests
    * Add list of tests that need to be skipped exclusively for valkey
  - Update valkey skipped test list to fix test suite with valkey >= 9.0.0
    (bsc#1252957)
  - Update general skipped test list with tests that fail in aarch64 and i586
  - Add redis_opts rpm macro
    * Allows us to properly check for redis/valkey >= 7.0.0, instead of
      grepping for known major versions when adding the needed cli options

OBS-URL: https://build.opensuse.org/request/show/1315971
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-redis?expand=0&rev=48
This commit is contained in:
2025-11-07 17:20:54 +00:00
committed by Git OBS Bridge
3 changed files with 79 additions and 29 deletions

View File

@@ -1,3 +1,17 @@
-------------------------------------------------------------------
Tue Nov 4 21:43:15 UTC 2025 - Antonio Teixeira <antonio.teixeira@suse.com>
- Rewrite logic for skipping tests
* Add skipped_tests
* Move list of skipped tests from spec to skipped_tests
* Add list of tests that need to be skipped exclusively for valkey
- Update valkey skipped test list to fix test suite with valkey >= 9.0.0
(bsc#1252957)
- Update general skipped test list with tests that fail in aarch64 and i586
- Add redis_opts rpm macro
* Allows us to properly check for redis/valkey >= 7.0.0, instead of
grepping for known major versions when adding the needed cli options
-------------------------------------------------------------------
Mon Nov 3 03:55:06 UTC 2025 - Steve Kowalik <steven.kowalik@suse.com>

View File

@@ -27,6 +27,9 @@
%bcond_with test
%endif
# Add needed cli opts when running redis-server if redis/valkey version >= 7.0.0
%define redis_opts %[v"%(%{_sbindir}/redis-server --version | cut -d " " -f "3" | tr -d "v=")" >= v"7.0.0" ? "--enable-debug-command yes --enable-module-command yes" : ""]
%{?sle15_python_module_pythons}
Name: python-redis%{psuffix}
Version: 7.0.1
@@ -37,6 +40,7 @@ URL: https://github.com/redis/redis-py
Source0: https://files.pythonhosted.org/packages/source/r/redis/redis-%{version}.tar.gz
# Based on https://github.com/redis/redis-py/blob/master/dockers/sentinel.conf
Source1: sentinel.conf
Source2: skipped_tests
Patch0: increase-test-timeout.patch
# PATCH-FIX-UPSTREAM Based on gh#redis/redis-py#3830
Patch1: remove-mock.patch
@@ -78,16 +82,6 @@ The Python interface to the Redis key-value store.
%patch -P 1 -p1
%patch -P 2 -p1
# These tests pass locally but fail in obs with different
# environment, like ALP build...
rm tests/test_commands.py*
rm tests/test_asyncio/test_commands.py
# The openSUSE redis json, bloom, ts
# are missing in the repos
rm tests/test_bloom.py
rm tests/test_json.py
rm tests/test_timeseries.py
%if %{without test}
%build
%pyproject_wheel
@@ -105,8 +99,7 @@ rm tests/test_timeseries.py
# We just start two of them locally
# master
# https://github.com/redis/redis/pull/9920
%{_sbindir}/redis-server --version | grep ' v=[78]\.' && redis7args="--enable-debug-command yes --enable-module-command yes"
%{_sbindir}/redis-server --port 6379 --save "" $redis7args &
%{_sbindir}/redis-server --port 6379 --save "" %redis_opts &
victims="$!"
# replica
%{_sbindir}/redis-server --port 6380 --save "" --replicaof localhost 6379 &
@@ -117,23 +110,11 @@ cp %{SOURCE1} .
victims="$victims $!"
trap "kill $victims || true" EXIT
sleep 2
# onlycluster: skip tests which require a full cluster
# redismod: Not available (https://github.com/RedisLabsModules/redismod)
# ssl: no stunnel with certs from docker container, fails at test collection
#
# broken tests in ppc64le
donttest="test_geopos or test_georadius"
# gh#redis/redis-py#2554
donttest="$donttest or test_xautoclaim"
# gh#python/cpython#70654 -- Fix only present in python313 so disable the tests
donttest+=" or test_re_auth_pub_sub_in_resp3 or test_do_not_re_auth_pub_sub_in_resp2"
# gh#redis/redis-py#2679
donttest+=" or test_acl_getuser_setuser or test_acl_log"
# Requires more set up of an endpoint
donttest+=" or TestPushNotifications"
# Requires more sentinel services running
donttest+=" or test_get_sentinels or test_get_master_addr_by_name"
%pytest -m 'not (onlycluster or redismod or ssl or graph)' -k "not ($donttest)" --ignore tests/test_ssl.py --ignore tests/test_asyncio/test_scenario --ignore tests/test_scenario/test_active_active.py --redis-url=redis://localhost:6379/
# load list of tests to skip from skipped_tests
source %{SOURCE2}
%pytest "${skipped_tests[@]}" $(%{_sbindir}/redis-server --version | grep -q 'Valkey' && echo "${valkey_skipped_tests[@]}") --redis-url=redis://localhost:6379/
%endif
%if %{without test}

55
skipped_tests Normal file
View File

@@ -0,0 +1,55 @@
skipped_tests=(
# onlycluster: skip tests which require a full cluster
# redismod: Not available (https://github.com/RedisLabsModules/redismod)
# ssl: no stunnel with certs from docker container, fails at test collection
-m='not (onlycluster or redismod or ssl)'
# broken tests in ppc64le
--deselect=tests/test_commands.py::TestRedisCommands::test_geopos
--deselect=tests/test_commands.py::TestRedisCommands::test_georadius
# broken in aarch64 and i586
--deselect=tests/test_asyncio/test_commands.py::TestRedisCommands::test_geopos
# broken tests in aarch64
--deselect=tests/test_asyncio/test_commands.py::TestRedisCommands::test_georadius_with
--deselect=tests/test_asyncio/test_commands.py::TestRedisCommands::test_georadius_store_dist
--deselect=tests/test_asyncio/test_commands.py::TestRedisCommands::test_georadiusmember
--deselect=tests/test_commands.py::TestRedisCommands::test_geosearch_member
--deselect=tests/test_commands.py::TestRedisCommands::test_geosearch_with
--deselect=tests/test_commands.py::TestRedisCommands::test_geosearchstore_dist
# gh#redis/redis-py#2554
--deselect=tests/test_commands.py::TestRedisCommands::test_xautoclaim
# gh#python/cpython#70654 -- Fix only present in python313 so disable the tests
--deselect=tests/test_asyncio/test_credentials.py::TestStreamingCredentialProvider::test_re_auth_pub_sub_in_resp3
--deselect=tests/test_asyncio/test_credentials.py::TestStreamingCredentialProvider::test_do_not_re_auth_pub_sub_in_resp2
# gh#redis/redis-py#2679
--deselect=tests/test_commands.py::TestRedisCommands::test_acl_list
# Requires more sentinel services running
--deselect=tests/test_sentinel.py::test_get_sentinels
--deselect=tests/test_sentinel.py::test_get_master_addr_by_name
--deselect=tests/test_asyncio/test_sentinel.py::test_get_sentinels
--deselect=tests/test_asyncio/test_sentinel.py::test_get_master_addr_by_name
# The openSUSE redis json, bloom, ts are missing in the repos
--ignore=tests/test_bloom.py
--ignore=tests/test_json.py
--ignore=tests/test_timeseries.py
# Tests that may require more set up and are ignored in upstream CI pipelines
--ignore=tests/test_scenario
--ignore=tests/test_asyncio/test_scenario
)
valkey_skipped_tests=(
# Tests that pass with redis but fail with valkey for various reasons
--deselect=tests/test_asyncio/test_commands.py::TestRedisCommands::test_readonly_invalid_cluster_state
--deselect=tests/test_asyncio/test_commands.py::TestRedisCommands::test_readonly_invalid_cluster_state
--deselect=tests/test_commands.py::TestRedisCommands::test_lolwut
--deselect=tests/test_commands.py::TestRedisCommands::test_readonly_invalid_cluster_state
--deselect=tests/test_commands.py::TestRedisCommands::test_xgroup_create_entriesread
)