Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unit tests don't work #331

Open
keuko opened this issue Sep 29, 2023 · 3 comments
Open

Unit tests don't work #331

keuko opened this issue Sep 29, 2023 · 3 comments
Labels
help wanted Extra attention is needed

Comments

@keuko
Copy link

keuko commented Sep 29, 2023

Hi,

I would like to build debian package for podman-py. Currently If i am trying to build the package , pytest fail, can u help me ?

Build :

.
.
.
writing manifest file 'podman.egg-info/SOURCES.txt'
dh_auto_test -O--buildsystem=pybuild
pybuild --test --test-pytest -i python{version} -p 3.11
I: pybuild base:291: cd /<>/.pybuild/cpython3_3.11_podman/build; python3.11 -m pytest
============================= test session starts ==============================
platform linux -- Python 3.11.5, pytest-7.4.2, pluggy-1.3.0
rootdir: /<>/.pybuild/cpython3_3.11_podman/build
configfile: pyproject.toml
plugins: requests-mock-1.9.3
collected 0 items

============================ no tests ran in 0.03s =============================
E: pybuild pybuild:395: test: plugin distutils failed with: exit code=5: cd /<>/.pybuild/cpython3_3.11_podman/build; python3.11 -m pytest
rm -fr -- /tmp/dh-xdg-rundir-gN5UfwCa
dh_auto_test: error: pybuild --test --test-pytest -i python{version} -p 3.11 returned exit code 13
make: *** [debian/rules:12: binary] Error 25
dpkg-buildpackage: error: debian/rules binary subprocess returned exit status 2

Pytest in CWD of podman git :

root@debian-sid-builder:/build/python-podman# pytest
=============================================================================================== test session starts ===============================================================================================
platform linux -- Python 3.11.2, pytest-7.2.1, pluggy-1.0.0+repack
rootdir: /build/python-podman, configfile: pyproject.toml
plugins: xdist-3.1.0, relaxed-1.0.0
collected 0 items / 1 error

===================================================================================================== ERRORS ======================================================================================================
__________________________________________________________________________________________ ERROR collecting test session __________________________________________________________________________________________
Direct construction of pytest_relaxed.classes.SpecModule has been deprecated, please use pytest_relaxed.classes.SpecModule.from_parent.
See https://docs.pytest.org/en/stable/deprecations.html#node-construction-changed-to-node-from-parent for more details.
============================================================================================= short test summary info =============================================================================================
ERROR
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
================================================================================================ 1 error in 0.19s =================================================================================================
root@debian-sid-builder:/build/python-podman#

Thanks

@rhatdan
Copy link
Member

rhatdan commented Sep 29, 2023

@jwhonce @umohnani8 @siretart PTAL

@rhatdan
Copy link
Member

rhatdan commented Sep 29, 2023

@keuko Can you make the change to:

Direct construction of pytest_relaxed.classes.SpecModule has been deprecated, please use pytest_relaxed.classes.SpecModule.from_parent.
See https://docs.pytest.org/en/stable/deprecations.html#node-construction-changed-to-node-from-parent for more details.```

It might be that Fedora is more lenient about this then Debian.

@jwhonce
Copy link
Member

jwhonce commented Sep 29, 2023

I suspect this is a dependency version issue as @rhatdan implied. The podman-py test suite does not currently lock down any versions for pytest. It uses the unittest library from the running python interrupter. But the supporting libraries fixtures or requests-mock could be the issue, they are also not locked down to any version.

Allowing the versions to float allows us to attempt to support python versions 3.6-3.11 across different platforms. It may be biting us here.

@umohnani8 umohnani8 added the help wanted Extra attention is needed label Jan 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

4 participants