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

Tests fail on Debian buster/bullseye and Ubuntu focal #51

Closed
mbanck opened this issue Sep 27, 2023 · 8 comments · Fixed by #55
Closed

Tests fail on Debian buster/bullseye and Ubuntu focal #51

mbanck opened this issue Sep 27, 2023 · 8 comments · Fixed by #55
Labels
bug Something isn't working

Comments

@mbanck
Copy link

mbanck commented Sep 27, 2023

The tests fail on Debian oldstable (bullseye):

I: pybuild base:232: cd /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9/build; python3.9 -m unittest discover -v 
tests.test_api (unittest.loader._FailedTest) ... ERROR
tests.test_cluster_config_has_changed (unittest.loader._FailedTest) ... ERROR
tests.test_cluster_has_leader (unittest.loader._FailedTest) ... ERROR
tests.test_cluster_has_replica (unittest.loader._FailedTest) ... ERROR
tests.test_cluster_has_scheduled_action (unittest.loader._FailedTest) ... ERROR
tests.test_cluster_is_in_maintenance (unittest.loader._FailedTest) ... ERROR
tests.test_cluster_node_count (unittest.loader._FailedTest) ... ERROR
tests.test_node_is_alive (unittest.loader._FailedTest) ... ERROR
tests.test_node_is_leader (unittest.loader._FailedTest) ... ERROR
tests.test_node_is_pending_restart (unittest.loader._FailedTest) ... ERROR
tests.test_node_is_primary (unittest.loader._FailedTest) ... ERROR
tests.test_node_is_replica (unittest.loader._FailedTest) ... ERROR
tests.test_node_patroni_version (unittest.loader._FailedTest) ... ERROR
tests.test_node_tl_has_changed (unittest.loader._FailedTest) ... ERROR

======================================================================
ERROR: tests.test_api (unittest.loader._FailedTest)
----------------------------------------------------------------------
ImportError: Failed to import test module: tests.test_api
Traceback (most recent call last):
  File "/usr/lib/python3.9/unittest/loader.py", line 436, in _find_test_path
    module = self._get_module_from_name(name)
  File "/usr/lib/python3.9/unittest/loader.py", line 377, in _get_module_from_name
    __import__(name)
  File "/<<PKGBUILDDIR>>/.pybuild/cpython3_3.9/build/tests/test_api.py", line 2, in <module>
    from pytest_mock import MockerFixture
ImportError: cannot import name 'MockerFixture' from 'pytest_mock' (/usr/lib/python3/dist-packages/pytest_mock.py)
[...]

As bullseye is still widely in use, it would be nice if the tests could be adjusted to pass there.

They also fail in the same way on buster and focal, but those are probably less relevant:
https://pgdgbuild.dus.dg-i.net/job/check-patroni-binaries/1/

@blogh blogh added the bug Something isn't working label Sep 27, 2023
@blogh
Copy link
Collaborator

blogh commented Sep 28, 2023

Hi,

@dlax is working on adding an http server to the tests.
It will allow for a better test coverage and ditch the mocker thing all together.

@dlax dlax mentioned this issue Oct 3, 2023
@dlax dlax closed this as completed in #55 Oct 6, 2023
@dlax
Copy link
Member

dlax commented Oct 6, 2023

This got closed by #55, but I'm not sure it's actually sufficient (although the original error indeed disappeared). In fact, check_patroni depends on click>=8.0.1 whereas bullseye has click 7.1.2 so I'm afraid this would be problematic as well.

@mbanck, are you able to try again with the master branch (or the bullseye one since I found another issue with old pytest)?

@dlax dlax reopened this Oct 6, 2023
@dlax
Copy link
Member

dlax commented Oct 6, 2023

check_patroni depends on click>=8.0.1 whereas bullseye has click 7.1.2

In fact, as far as the test suite is concerned, we appear to support 7.1.2.

@dlax
Copy link
Member

dlax commented Oct 6, 2023

Went further on this issue and submitted #59, which brings compatibility with bullseye and focal.

@mbanck
Copy link
Author

mbanck commented Oct 6, 2023

I included the PR#55 as of this morning in a run on the PGDG build infrastructure and tests ran fine everywhere:
https://pgdgbuild.dus.dg-i.net/job/check-patroni-binaries/3/

@dlax
Copy link
Member

dlax commented Oct 6, 2023

Are you sure the test suite is run?

https://pgdgbuild.dus.dg-i.net/job/check-patroni-binaries/3/architecture=amd64,distribution=bullseye/console shows:

09:44:38 I: pybuild base:232: cd /<>/.pybuild/cpython3_3.9/build; python3.9 -m unittest discover -v
09:44:38
09:44:38 ----------------------------------------------------------------------
09:44:38 Ran 0 tests in 0.000s

Or maybe I'm not looking at the right place?

@mbanck
Copy link
Author

mbanck commented Oct 6, 2023

No you're right, they were not run, sigh.

And now that I managed to run them, they fail all over the place due to #54 and #58

@blogh
Copy link
Collaborator

blogh commented Feb 26, 2024

Hi, do they pass now ?

@blogh blogh closed this as completed Nov 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants