Bug 2220180
| Summary: | F39FailsToInstall: python3-daiquiri | ||
|---|---|---|---|
| Product: | [Fedora] Fedora | Reporter: | Fedora Fails To Install <fti-bugs> |
| Component: | python-daiquiri | Assignee: | Joel Capitao <jcapitao> |
| Status: | CLOSED WORKSFORME | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
| Severity: | unspecified | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | rawhide | CC: | epel-packagers-sig, jcapitao, karlthered, openstack-sig |
| Target Milestone: | --- | ||
| Target Release: | --- | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | If docs needed, set a value | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2023-07-19 08:05:23 UTC | Type: | --- |
| 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: | 2135404, 2168845, 2220002 | ||
|
Description
Fedora Fails To Install
2023-07-05 19:10:15 UTC
=================================== FAILURES ===================================
____________________ TestDaiquiri.test_setup_json_formatter ____________________
self = <daiquiri.tests.test_daiquiri.TestDaiquiri testMethod=test_setup_json_formatter>
def test_setup_json_formatter(self) -> None:
stream = io.StringIO()
daiquiri.setup(
outputs=(
daiquiri.output.Stream(
stream, formatter=daiquiri.formatter.JSON_FORMATTER
),
)
)
daiquiri.getLogger(__name__).warning("foobar")
> self.assertEqual({"message": "foobar"}, json.loads(stream.getvalue()))
E AssertionError: {'message': 'foobar'} != {'message': 'foobar', 'taskName': None}
E - {'message': 'foobar'}
E + {'message': 'foobar', 'taskName': None}
daiquiri/tests/test_daiquiri.py:42: AssertionError
______________ TestDaiquiri.test_setup_json_formatter_with_extras ______________
self = <daiquiri.tests.test_daiquiri.TestDaiquiri testMethod=test_setup_json_formatter_with_extras>
def test_setup_json_formatter_with_extras(self) -> None:
stream = io.StringIO()
daiquiri.setup(
outputs=(
daiquiri.output.Stream(
stream, formatter=daiquiri.formatter.JSON_FORMATTER
),
)
)
daiquiri.getLogger(__name__).warning("foobar", foo="bar")
> self.assertEqual(
{"message": "foobar", "foo": "bar"}, json.loads(stream.getvalue())
)
E AssertionError: {'message': 'foobar', 'foo': 'bar'} != {'message': 'foobar', 'taskName': None, 'foo': 'bar'}
E - {'foo': 'bar', 'message': 'foobar'}
E + {'foo': 'bar', 'message': 'foobar', 'taskName': None}
E ? ++++++++++++++++++
daiquiri/tests/test_daiquiri.py:54: AssertionError
___________________________ TestOutput.test_datadog ____________________________
self = <daiquiri.tests.test_output.TestOutput testMethod=test_datadog>
def test_datadog(self) -> None:
with mock.patch("socket.socket") as mock_socket:
socket_instance = mock_socket.return_value
daiquiri.setup(outputs=(daiquiri.output.Datadog(),), level=logging.DEBUG)
logger = daiquiri.getLogger()
logger.error("foo", bar=1)
logger.info("bar")
try:
1 / 0
except ZeroDivisionError:
logger = daiquiri.getLogger("saymyname")
logger.error("backtrace", exc_info=True)
socket_instance.connect.assert_called_once_with(("127.0.0.1", 10518))
> socket_instance.sendall.assert_has_calls(
[
mock.call(
DatadogMatcher(
{
"status": "error",
"message": "foo",
"bar": 1,
"logger": {"name": "root"},
"timestamp": mock.ANY,
}
)
),
mock.call(
DatadogMatcher(
{
"status": "info",
"message": "bar",
"logger": {"name": "root"},
"timestamp": mock.ANY,
}
)
),
mock.call(
DatadogMatcher(
{
"status": "error",
"message": "backtrace",
"logger": {"name": "saymyname"},
"timestamp": mock.ANY,
"error": {
"kind": "ZeroDivisionError",
"stack": None,
"message": mock.ANY,
},
}
)
),
]
)
daiquiri/tests/test_output.py:109:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <MagicMock name='socket().sendall' id='140706521580896'>
calls = [call(b'{"status": "error", "message": "foo", "bar": 1, "logger": {"name": "root"}, "timestamp": "unserializable"}\n')..."timestamp": "unserializable", "error": {"kind": "ZeroDivisionError", "stack": null, "message": "unserializable"}}\n')]
any_order = False
def assert_has_calls(self, calls, any_order=False):
"""assert the mock has been called with the specified calls.
The `mock_calls` list is checked for the calls.
If `any_order` is False (the default) then the calls must be
sequential. There can be extra calls before or after the
specified calls.
If `any_order` is True then the calls can be in any order, but
they must all appear in `mock_calls`."""
expected = [self._call_matcher(c) for c in calls]
cause = next((e for e in expected if isinstance(e, Exception)), None)
all_calls = _CallList(self._call_matcher(c) for c in self.mock_calls)
if not any_order:
if expected not in all_calls:
if cause is None:
problem = 'Calls not found.'
else:
problem = ('Error processing expected calls.\n'
'Errors: {}').format(
[e if isinstance(e, Exception) else None
for e in expected])
> raise AssertionError(
f'{problem}\n'
f'Expected: {_CallList(calls)}'
f'{self._calls_repr(prefix="Actual").rstrip(".")}'
) from cause
E AssertionError: Calls not found.
E Expected: [call(b'{"status": "error", "message": "foo", "bar": 1, "logger": {"name": "root"}, "timestamp": "unserializable"}\n'),
E call(b'{"status": "info", "message": "bar", "logger": {"name": "root"}, "timestamp": "unserializable"}\n'),
E call(b'{"status": "error", "message": "backtrace", "logger": {"name": "saymyname"}, "timestamp": "unserializable", "error": {"kind": "ZeroDivisionError", "stack": null, "message": "unserializable"}}\n')]
E Actual: [call(b'{"message": "foo", "taskName": null, "bar": 1, "timestamp": "2023-07-10T14:54:54.024694+00:00", "status": "error", "logger": {"name": "root"}}\n'),
E call(b'{"message": "bar", "taskName": null, "timestamp": "2023-07-10T14:54:54.027714+00:00", "status": "info", "logger": {"name": "root"}}\n'),
E call(b'{"message": "backtrace", "taskName": null, "timestamp": "2023-07-10T14:54:54.027859+00:00", "status": "error", "logger": {"name": "saymyname"}, "error": {"kind": "ZeroDivisionError", "stack": null, "message": "Traceback (most recent call last):\\n File \\"/builddir/build/BUILD/daiquiri-3.2.1/daiquiri/tests/test_output.py\\", line 104, in test_datadog\\n 1 / 0\\n ~~^~~\\nZeroDivisionError: division by zero"}}\n')]
/usr/lib64/python3.12/unittest/mock.py:981: AssertionError
=========================== short test summary info ============================
FAILED daiquiri/tests/test_daiquiri.py::TestDaiquiri::test_setup_json_formatter
FAILED daiquiri/tests/test_daiquiri.py::TestDaiquiri::test_setup_json_formatter_with_extras
FAILED daiquiri/tests/test_output.py::TestOutput::test_datadog - AssertionErr...
=================== 3 failed, 17 passed, 1 warning in 0.21s ====================
I proposed a patch upstream https://github.com/Mergifyio/daiquiri/pull/74 which only works with python3.12 I will apply it at distgit level to unblock. (In reply to Joel Capitao from comment #2) > I proposed a patch upstream https://github.com/Mergifyio/daiquiri/pull/74 > which only works with python3.12 > I will apply it at distgit level to unblock. It's now backward compatible with older Python releases. I'll wait a little bit for the patch to be merged upstream. I don't want to put pressure on upstream folks. So, in order to unblock the situation, I disabled the tests failing as it's test issue only. https://src.fedoraproject.org/rpms/python-daiquiri/c/9bc76401eff44940ff79aaefac890c30022f2921?branch=rawhide https://koji.fedoraproject.org/koji/taskinfo?taskID=103546216 I'll follow my patch upstream https://github.com/Mergifyio/daiquiri/pull/74, and will propose an update once the patch is merged and contained in a new release. |