Commit 068f97c0 authored by Kirill Smelkov's avatar Kirill Smelkov

lib/zodb: Mark test_zconn_at as xfail on plain ZODB4

This way on plain ZODB4 the following non-wcfs tests will continue to
pass

   test.py/fs-!wcfs
   test.py/zeo-!wcfs
   test.py/neo-!wcfs

instead of failing as e.g. in here:

   https://nexedijs.erp5.net/#/test_result_module/20211116-123A66706

On plain ZODB4 WCFS-related functionality - which uses zconn_at - will
continue to raise corresponding assertion in WCFS-related tests, as e.g. in

https://nexedijs.erp5.net/#/test_result_module/20211116-123A66706/6
parent 5f684a49
......@@ -17,7 +17,7 @@
#
# See COPYING file for full licensing terms.
# See https://www.nexedi.com/licensing for rationale and options.
from wendelin.lib.zodb import LivePersistent, deactivate_btree, dbclose, zconn_at, zstor_2zurl
from wendelin.lib.zodb import LivePersistent, deactivate_btree, dbclose, zconn_at, zstor_2zurl, zmajor, _zhasNXDPatch
from wendelin.lib.testing import getTestDB
from wendelin.lib import testing
from persistent import Persistent, UPTODATE, GHOST, CHANGED
......@@ -238,6 +238,9 @@ def test_deactivate_btree():
# verify that zconn_at gives correct answer.
@func
def test_zconn_at():
if zmajor == 4 and not _zhasNXDPatch('conn:MVCC-via-loadBefore-only'):
pytest.xfail(reason="zconn_at needs https://lab.nexedi.com/nexedi/ZODB/merge_requests/1 to work on ZODB4")
stor = testdb.getZODBStorage()
defer(stor.close)
db = DB(stor)
......
......@@ -182,12 +182,17 @@ def before2at(before): # -> at
# _zassertHasNXDPatch asserts that ZODB is patched with specified Nexedi-provided patch.
def _zassertHasNXDPatch(patch, details_link):
nxd_patches = getattr(ZODB, 'nxd_patches', set())
if patch not in nxd_patches:
if not _zhasNXDPatch(patch):
raise AssertionError(
"ZODB%s is not patched with required Nexedi patch %r\n\tSee %s for details" %
(zmajor, patch, details_link))
# _zhasNXDPatch returns whether ZODB is patched with specified Nexedi-provided patch.
def _zhasNXDPatch(patch):
nxd_patches = getattr(ZODB, 'nxd_patches', set())
return (patch in nxd_patches)
# _zversion returns ZODB version object
def _zversion():
dzodb3 = pkg_resources.working_set.find(pkg_resources.Requirement.parse('ZODB3'))
......
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