Bug 1915256
Summary: | freeipa-healthcheck fails to build with Python 3.10: Result.__init__() repr has changed | ||
---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Tomáš Hrnčiar <thrnciar> |
Component: | freeipa-healthcheck | Assignee: | François Cami <fdc> |
Status: | CLOSED RAWHIDE | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
Severity: | unspecified | Docs Contact: | |
Priority: | unspecified | ||
Version: | rawhide | CC: | abokovoy, cheimes, fdc, mhroncok, mkosek, pvoborni, rcritten, thrnciar, twoerner |
Target Milestone: | --- | Keywords: | Reopened |
Target Release: | --- | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | freeipa-healthcheck-0.8-1.fc34 | Doc Type: | If docs needed, set a value |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2021-06-07 17:47:43 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: | |||
Bug Depends On: | |||
Bug Blocks: | 1890881 |
Description
Tomáš Hrnčiar
2021-01-12 10:59:28 UTC
Many errors are:
def no_exceptions(results):
"""Given Results ensure that an except was not raised"""
> for result in results.results:
E AttributeError: 'NoneType' object has no attribute 'results'
And:
E AttributeError: <module 'ipaserver.dns_data_management' from '/usr/lib/python3.10/site-packages/ipaserver/dns_data_management.py'> does not have the attribute 'resolve_rrsets'
One is:
E assert "Result.__ini... and 'result'" == "__init__() m... and 'result'"
E - __init__() missing 2 required positional arguments: 'plugin' and 'result'
E + Result.__init__() missing 2 required positional arguments: 'plugin' and 'result'
E ? +++++++
Tests are failing because https://pagure.io/freeipa/issue/8529 removed import of resolve_rrsets ________________ TestDNSSystemRecords.test_dnsrecords_bad_realm ________________ /usr/lib64/python3.10/unittest/mock.py:1348: in patched with self.decoration_helper(patched, /usr/lib64/python3.10/contextlib.py:133: in __enter__ return next(self.gen) /usr/lib64/python3.10/unittest/mock.py:1330: in decoration_helper arg = exit_stack.enter_context(patching) /usr/lib64/python3.10/contextlib.py:478: in enter_context result = _cm_type.__enter__(cm) /usr/lib64/python3.10/unittest/mock.py:1419: in __enter__ original, local = self.get_original() _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <unittest.mock._patch object at 0x7f47ce41ecd0> def get_original(self): target = self.getter() name = self.attribute original = DEFAULT local = False try: original = target.__dict__[name] except (AttributeError, KeyError): original = getattr(target, name, DEFAULT) else: local = True if name in _builtins and isinstance(target, ModuleType): self.create = True if not self.create and original is DEFAULT: > raise AttributeError( "%s does not have the attribute %r" % (target, name) ) E AttributeError: <module 'ipaserver.dns_data_management' from '/usr/lib/python3.10/site-packages/ipaserver/dns_data_management.py'> does not have the attribute 'resolve_rrsets' /usr/lib64/python3.10/unittest/mock.py:1392: AttributeError The resolve_rrsets issue should already be handled by https://github.com/freeipa/freeipa-healthcheck/commit/30d97eff4b932001a1c1771cc64743752115ea6f which is in freeipa-healthcheck-0.7 in rawhide. I'll take a look. I've reproduced additional failures in rawhide using python 3.9 that I need to get through first. It looks related to data new validations added to python3-dns-2.1.0-1. The test is doing the absolute minimum to fake a DNS response and that is no longer sufficient for python3-dns. The 0.7 tarball doesn't match the upstream 0.7 tag by two commits. The resolve_rrsets change is one of them :/ I'm not sure how this happened or what I want to do about it. I'm going to do another upstream release to fix the missing commit issue in addition to PR https://github.com/freeipa/freeipa-healthcheck/pull/177 which will fix test execution with python3-dns-2.1.0. Hello, thank you for the fix. Sadly, there is still one more test failing. For complete log see: https://download.copr.fedorainfracloud.org/results/@python/python3.10/fedora-rawhide-x86_64/01879241-freeipa-healthcheck/builder-live.log.gz =================================== FAILURES =================================== _________________________________ test_Result __________________________________ def test_Result(): """ Test the `ipahealthcheck.plugin.Result` class """ registry = Registry() p = Plugin(registry) # Standard case of passing plugin to Result r = Result(p, constants.SUCCESS) kw = dict(key='value') r = Result(p, constants.SUCCESS, **kw) e = raises(TypeError, Result) > assert str(e) == "__init__() missing 2 required positional arguments: " \ "'plugin' and 'result'" E assert "Result.__ini... and 'result'" == "__init__() m... and 'result'" E - __init__() missing 2 required positional arguments: 'plugin' and 'result' E + Result.__init__() missing 2 required positional arguments: 'plugin' and 'result' E ? +++++++ tests/test_results.py:25: AssertionError =========================== short test summary info ============================ FAILED tests/test_results.py::test_Result - assert "Result.__ini... and 'resu... ======================== 1 failed, 120 passed in 1.93s ========================= Ok I see the problem. Looks like python 3.10 is adding the class name to the exception. I have a fix, do you need a build or is pushing the patch to distgit sufficient? Pushing the patch to distgit is sufficient. If you open a PR, the copr repo will attempt to build it in https://copr.fedorainfracloud.org/coprs/g/python/python3.10/builds/?dirname=python3.10:pr:<pr_number> I'm not sure how to do that against copr. I created a PR against the healthcheck dist-git, maybe you can cherry-pick that? https://src.fedoraproject.org/rpms/freeipa-healthcheck/pull-request/3 That's it, your build is in https://copr.fedorainfracloud.org/coprs/g/python/python3.10/builds/?dirname=python3.10:pr:3 and it is a success. When you merge the PR, it will be built in the copr's main directory. This bug appears to have been reported against 'rawhide' during the Fedora 34 development cycle. Changing version to 34. This is a mass-posted update. Sorry if it is not 100% accurate to this bugzilla. The Python 3.10 rebuild is in progress in a Koji side tag. If you manage to fix the problem, please commit the fix in the rawhide branch, but don't build the package in regular rawhide. You can either build the package in the side tag, with: $ fedpkg build --target=f35-python Or you can the build and we will eventually build it for you. Note that the rebuild is still in progress, so not all (build) dependencies of this package might be available right away. Thanks. See also https://fedoraproject.org/wiki/Changes/Python3.10 If you have general questions about the rebuild, please use this mailing list thread: https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/thread/G47SGOYIQLRDTWGOSLSWERZSSHXDEDH5/ This fix was merged but the BZ never closed. |