From 0cccfa3fb6b941d1194e49474f49368741bdad21b9f9a9bcb424885b6deddbb8 Mon Sep 17 00:00:00 2001 From: Daniel Garcia Date: Tue, 24 Oct 2023 10:33:14 +0000 Subject: [PATCH] - Run redis server on %check to fix redis tests that depends on a real redis server running. OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-mocket?expand=0&rev=65 --- python-mocket.changes | 6 ++++++ python-mocket.spec | 12 +++++++++--- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/python-mocket.changes b/python-mocket.changes index e192215..6447f2e 100644 --- a/python-mocket.changes +++ b/python-mocket.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Tue Oct 24 10:15:32 UTC 2023 - Daniel Garcia + +- Run redis server on %check to fix redis tests that depends on a real + redis server running. + ------------------------------------------------------------------- Fri May 12 10:42:12 UTC 2023 - Markéta Machová diff --git a/python-mocket.spec b/python-mocket.spec index 11587cd..18febf2 100644 --- a/python-mocket.spec +++ b/python-mocket.spec @@ -57,6 +57,7 @@ BuildRequires: %{python_module requests} BuildRequires: %{python_module sure} BuildRequires: %{python_module xxhash} BuildRequires: ca-certificates-mozilla +BuildRequires: redis %endif %python_subpackages @@ -90,10 +91,15 @@ export SKIP_TRUE_HTTP=1 # Ignore tests which are not supported on Python 3.6 pytest_python3_ignore="--ignore tests/tests37 --ignore tests/tests38" %endif -# Requires a running Redis server -donttest="TrueRedisTestCase" + +%{_sbindir}/redis-server --version | grep ' v=7\.' && redis7args="--enable-debug-command yes --enable-module-command yes" +%{_sbindir}/redis-server --port 6379 --save "" $redis7args & +victims="$!" +trap "kill $victims || true" EXIT +sleep 2 + # Checks the ability to record a real request and response. Not available inside obs. -donttest="$donttest or test_asyncio_record_replay" +donttest="test_asyncio_record_replay" # The reference recording has different headers in this case %if %{pkg_vcmp python3-httpx < 0.23} donttest="$donttest or test_truesendall_with_dump_from_recording"