Commit d451de4f authored by Kirill Smelkov's avatar Kirill Smelkov

ZODB: Add testing support

Organize testing of ZODB 3/4/5 on Nexedi testing infrastructure.

ZODB is core component that we rely on everywhere, and given that this days
upstream is not very active, and we are going to add our own patches to ZODB,
we should add automatic testing to make sure that our ZODB is in good shape.
parent c4d69762
# SlapOS software release to test ZODB on Nexedi testing infrastructure.
# Common parts.
[buildout]
extends =
# test<X>.cfg configures ZODB.major=<X>.
../../stack/nxdtest.cfg
../pygolang/buildout.cfg
../python-manuel/buildout.cfg
buildout-dev.cfg
../ZEO/buildout.cfg
parts =
ZODB
.nxdtest
# for instance
ZODB-python
slapos-cookbook
instance.cfg
# test-dependent eggs that must come through in-tree recipes.
[ZODB]
depends += ${manuel:egg}
# bin/python is preinstalled with sys.path to ZODB & friends.
[ZODB-python]
<= python-interpreter
eggs +=
${ZODB:egg}[test]
${ZEO:egg}[test]
transaction[test]
# env.sh for ZODB's python to be on $PATH.
[ZODB-env.sh]
recipe = slapos.recipe.template:jinja2
rendered = ${buildout:directory}/${:_buildout_section_name_}
template = inline:
export PS1="(ZODB-env) $PS1"
export PATH=${buildout:bin-directory}:$PATH
# .nxdtest to run ZODB tests
[.nxdtest]
<= jinja2-template
template = inline:
# determine where ZODB & friends were installed
from subprocess import check_output
_ = check_output(['python', '-c',
'from os.path import dirname\n'+
'def X(mod): m=__import__(mod); print(dirname(m.__file__))\n\n'+
'X("ZODB"); X("persistent"); X("BTrees"); X("transaction"), X("ZEO")'])
ZODB, persistent, BTrees, transaction, ZEO = _.split()
# run tests for whole ZODB stack
TestCase('ZODB/unit', ['python', '-m', 'zope.testrunner', '-uv', '--package-path', ZODB, 'ZODB'])
TestCase('ZODB/functional', ['python', '-m', 'zope.testrunner', '-fv', '--package-path', ZODB, 'ZODB'])
TestCase('ZEO/unit', ['python', '-m', 'zope.testrunner', '-uv', '--package-path', ZEO, 'ZEO'])
TestCase('ZEO/functional', ['python', '-m', 'zope.testrunner', '-fv', '--package-path', ZEO, 'ZEO'])
TestCase('persistent', ['python', '-m', 'zope.testrunner', '-v', '--package-path', persistent, 'persistent'])
TestCase('BTrees', ['python', '-m', 'zope.testrunner', '-v', '--package-path', BTrees, 'BTrees'])
# transaction uses unittest instead of zope.testrunner
import os.path
def P(path): return os.path.join(path, '..')
TestCase('transaction',['python', '-m', 'unittest', 'discover', '-s', P(transaction)])
# instance to run nxdtest.
[instance.cfg]
<= jinja2-template
template = inline:
[buildout]
extends = ${nxdtest-instance.cfg:rendered}
[runTestSuite]
env.sh = ${ZODB-env.sh:rendered}
workdir = ${buildout:directory}
# SlapOS software release to test ZODB3 on Nexedi testing infrastructure.
[buildout]
extends = test-common.cfg
[ZODB]
major = 3
# SlapOS software release to test ZODB5 on Nexedi testing infrastructure.
[buildout]
extends = test-common.cfg
[ZODB]
major = 5
# NOTE with default zope.testing=3.9.7 it fails with
# setupstack.TestCase -> AttributeError: 'module' object has no attribute 'TestCase'
[versions]
zope.testing = 4.7
# SlapOS software release to test ZODB on Nexedi testing infrastructure.
[buildout]
extends = test-common.cfg
[ZODB]
major = 4
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