Open kloczek opened 5 months ago
And here it is full pytest output as well in attachment python-redis.FAIL.txt
Hi @kloczek ,
Thanks for reporting this. There were recent changes to the redis-stack-server
docker image, I also struggled a bit to make the CI work for 5.0.6. However, at the end the only notable change should be that the Graph module is no longer packaged with Redis Stack.
In your case I see that all modules related tests are failing. Can you give me details on how do you start the Redis server for your tests. I can't figure it out from the output you sent. Thanks!
Parr of my python-redis.spec with %check section:
%check
%{!?with_check:exit 0}
%__mkdir_p .redis-data
%__cat << EOF | redis-server - &
dir .redis-data
EOF
%pytest -m "not onlycluster"
I've assed injection into executed redis-server dir .redis-data
because in few cases was printed message about wring data to the storage by redis-server/.
IMO best would be add redis-server start and stop in pytest session and to do not relying on external start of the redis-server https://til.simonwillison.net/pytest/subprocess-server You can find example of use that with redis in https://github.com/dsoftwareinc/fakeredis-py/
Thanks for the details. From what I see, you don't include any modules in the Redis configuration, which would explain why all the modules-related tests fail. Where does the redis-server
binary come from? You build locally, you install it via a package manager?
redis server is installed from package. I'm using redis 7.2.5.
Got it. Did this ever work, or are you setting this up now for the first time?
If you are setting this up, the solution is to include the modules in your Redis instance. The easiest way would be with Redis Stack, not sure if you can install that from package.
Nope .. never worked 😞
Please .. I'm not going to follow that documentation. My package is very close to what is in fedora rawhide.
If something is wrong with testing procedure which details I've already shared please point on those details to allow me test exact configuration. I'm really opened on altering testing procedure to diagnose the issue but installation of whole new distro is not such proposition.
Got it. I see two options in this case:
You don't run tests related to Redis cluster and Redis modules. You can add this to pytest
: -m 'not onlycluster and not redismod'
One way or another you boot up a Redis Stack instance, which has all modules included. Then you'll have the next problem with booting up a Redis cluster. In our CI we do that by running invoke devenv
, you can check tasks.py
. It is based on Docker, which might not be a good thing for your case.
Pytest allow run service (start and stop) in pytest session. It would be really good to embed running redis or whatever will be necessary for whole pytest session or set of units instead rely on start those services before start pytest.
Version: 5.0.6 Platform: Linux x86/64, Python 3.10.14 Description: pytest fails in multiple units
I'm packaging your module as an rpm package so I'm using the typical PEP517 based build, install and test cycle used on building packages from non-root account.
python3 -sBm build -w --no-isolation
build
with--no-isolation
I'm using during all processes only locally installed modulesinstaller
modulecut off from access to the public network
(pytest is executed with-m "not network"
)List of installed modules in build env:
```console Package Version ----------------------------- ----------- alabaster 0.7.16 async-timeout 4.0.3 Babel 2.15.0 build 1.2.1 charset-normalizer 3.3.2 defusedxml 0.7.1 Deprecated 1.2.14 distro 1.9.0 docutils 0.20.1 exceptiongroup 1.1.3 imagesize 1.4.1 importlib_metadata 7.1.0 iniconfig 2.0.0 installer 0.7.0 Jinja2 3.1.4 MarkupSafe 2.1.5 olefile 0.47 packaging 24.0 pillow 10.3.0 pluggy 1.5.0 Pygments 2.18.0 pyproject_hooks 1.0.0 pytest 8.2.2 pytest-asyncio 0.23.7 python-dateutil 2.9.0.post0 requests 2.32.3 setuptools 69.4.0 snowballstemmer 2.2.0 Sphinx 7.3.7 sphinx-autodoc-typehints 2.1.1 sphinx-gallery 0.15.0 sphinxcontrib-applehelp 1.0.8 sphinxcontrib-devhelp 1.0.6 sphinxcontrib-htmlhelp 2.0.5 sphinxcontrib-jsmath 1.0.1 sphinxcontrib-qthelp 1.0.7 sphinxcontrib-serializinghtml 1.1.10 tokenize_rt 5.2.0 tomli 2.0.1 urllib3 2.2.1 wheel 0.43.0 wrapt 1.16.0 zipp 3.19.2 ```Please let me know if you need more details or want me to perform some diagnostics.