test-zodb4-wc2.cfg 3.29 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115
# SlapOS software release to test ZODB4-wc2 on Nexedi testing infrastructure.

[buildout]
extends =
# test<X>.cfg configures ZODB.major=<X>.

    ../../stack/nxdtest.cfg
    ../pygolang/buildout.cfg
    ../python-manuel/buildout.cfg
    buildout.cfg
    ../ZEO/buildout.cfg

parts =
    ZODB
    .nxdtest

#   for instance
    ZODB-python
    slapos-cookbook
    instance.cfg

[ZODB]
major = 4-wc2
[ZODB4-wc2-repository]
revision =

# we need persistent to be a git checkout because persistent tests want to
# discover in-tree files that are not present in persistent egg when it is
# installed in non-development mode:
#
#   https://erp5.nexedi.net/test_result_module/20201123-3F859E35/7
#   (look for "AssertionError: could not find my setup.py")
#
#   https://github.com/zopefoundation/persistent/blob/4.6.4-0-g7ed95cf/persistent/tests/test_docs.py#L37-L43
[persistent]
recipe = zc.recipe.egg:develop
setup = ${persistent-repository:location}

[persistent-repository]
recipe  = slapos.recipe.build:gitclone
location = ${buildout:parts-directory}/persistent
repository = https://github.com/zopefoundation/persistent.git
branch = master
revision = 4.6.4-0-g7ed95cf
git-executable = ${git:location}/bin/git


# 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
  where = check_output(['python', '-c', """if 1:
        from os.path import dirname
        for m in "ZODB", "persistent", "BTrees", "transaction", "ZEO":
            print(dirname(__import__(m).__file__))
  """])
  ZODB, persistent, BTrees, transaction, ZEO = where.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}


[versions]
random2 = 1.0.1
zope.testing = 4.7
zope.testrunner = 5.2
zope.exceptions = 4.4