Commit c053fb22 authored by Kirill Smelkov's avatar Kirill Smelkov

tests: Fix ztestdata-related tests on ZODB4

In bf772ce0 I introduced ztestdata fixture and we added several tests
that use this fixture instead of only zext fixture. But contrary to zext
I missed to corresponding xfail if underlying ZODB is ZODB4 and does not
support access to raw extension bytes. As the result several tests
started to fail with ZODB4, because on such ZODB extension is only
dumped via heuristic and on best-effort basis and that cannot match
original extension data bit to bit exactly:

https://lab.nexedi.com/nexedi/zodbtools/-/blob/36cba871/zodbtools/zodbdump.py#L93-102

One example failure is here:

https://erp5js.nexedi.net/#/test_result_module/20241017-58899E0D/2

-> Fix that by xfailing in both zext and ztestdata fixtures
consistently.
Co-authored-by: Jérome Perrin's avatarJérome Perrin <jerome@nexedi.com>
parent b0fdb5fe
...@@ -50,6 +50,8 @@ def ztestdata(request): # -> ZTestData ...@@ -50,6 +50,8 @@ def ztestdata(request): # -> ZTestData
_.name = name _.name = name
_.zext = zext _.zext = zext
_.zkind = zkind _.zkind = zkind
if zext:
_xfail_if_zext_unsupported(request)
return _ return _
class ZTestData(object): class ZTestData(object):
...@@ -96,11 +98,15 @@ def zext(request): ...@@ -96,11 +98,15 @@ def zext(request):
def _(ext): def _(ext):
return ext return ext
_.disabled = False _.disabled = False
if not zext_supported(): _xfail_if_zext_unsupported(request)
request.applymarker(pytest.mark.xfail(reason='ZODB does not have txn.extension_bytes support'))
return _ return _
# _xfail_if_zext_unsupported applies xfail marker to request if zext is not supported by ZODB.
def _xfail_if_zext_unsupported(request):
if not zext_supported():
request.applymarker(pytest.mark.xfail(reason='ZODB does not have txn.extension_bytes support'))
# TestZSrv is base class for all test ZODB storages. # TestZSrv is base class for all test ZODB storages.
class TestZSrv(object): class TestZSrv(object):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment