Commit c7fde206 authored by Xavier Thompson's avatar Xavier Thompson

software/buildout-testing: Reuse installed eggs

Install test eggs in software and pass them to runTestSuite so that
launching the tests reuses the installed eggs.
parent 26d591ae
......@@ -18,6 +18,9 @@ test_dict = {
'zc.recipe.egg': os.path.join(slapos_buildout, 'zc.recipe.egg_'),
}
already_available_egg_paths = {{ repr(egg_paths) }}
class DummyTestResult:
class DummyTestResultLine:
......@@ -98,17 +101,12 @@ def main():
try:
os.write(fd, str2bytes("""\
[buildout]
develop =%s
develop =
%s
parts = testrunner
newest = false
versions = versions
[versions]
%s
zope.exceptions = 4.6
zope.interface = 5.4.0
zope.testing = 4.7
zope.testrunner = 5.2
offline = true
extra-paths =
%s
[testrunner]
recipe = zc.recipe.egg
......@@ -119,11 +117,13 @@ eggs =
zope.testrunner
scripts =
zope-testrunner
extra-paths =%s
""" % (''.join('\n ' + x for x in test_dict.values()),
'\n'.join(x + ' =' for x in test_dict),
''.join('\n ' + get_distribution(x).location for x in ('manuel', 'six')),
)))
extra-paths =
%s
""" % (
'\n '.join(x for x in test_dict.values()),
'\n '.join(p for p in already_available_egg_paths),
'\n '.join(get_distribution(x).location for x in ('manuel', 'six')),
)))
finally:
os.close(fd)
Buildout('buildout.cfg', {}).install(None)
......
......@@ -7,17 +7,29 @@ parts =
[slapos.buildout-repository]
recipe = slapos.recipe.build:gitclone
repository = https://lab.nexedi.com/nexedi/slapos.buildout.git
repository = https://lab.nexedi.com/xavier_thompson/slapos.buildout.git
branch = testing/buildout
git-executable = ${git:location}/bin/git
[runTestSuite_py]
recipe = zc.recipe.egg
eggs = erp5.util
zc.buildout
manuel
eggs =
erp5.util
zc.buildout[test]
zope.exceptions
zope.interface
zope.testing
zope.testrunner
scripts = ${:interpreter}
interpreter = ${:_buildout_section_name_}
[egg-list]
recipe = slapos.recipe.build
eggs = ${runTestSuite_py:eggs}
init =
options['egg-list'] = '\n '.join(options['eggs'].split())
[template]
recipe = slapos.recipe.template
# XXX: "template.cfg" is hardcoded in instanciation recipe
......@@ -47,6 +59,22 @@ inline =
git-executable = ${git:location}/bin/git
shared = true
[egg-paths]
recipe = slapos.recipe.build
eggs = ${egg-list:egg-list}
init =
import zc.buildout.easy_install
eggs = options['eggs'].split()
buildout = self.buildout['buildout']
ws = zc.buildout.easy_install.working_set(
eggs,
[buildout['eggs-directory'], buildout['develop-eggs-directory']],
)
options['egg-paths'] = [
d.location for d in ws
if d.project_name not in ('zc.buildout', 'zc.recipe.egg')
]
[runTestSuite]
recipe = slapos.recipe.template:jinja2
output = $${directory:bin}/$${:_buildout_section_name_}
......@@ -55,4 +83,15 @@ inline =
key slapparameter_dict slap-configuration:configuration
key slapos_buildout slapos.buildout-repository:location
key temp_directory directory:tmp
key egg_paths egg-paths:egg-paths
raw runTestSuite_py ${buildout:bin-directory}/${runTestSuite_py:interpreter}
[versions]
zope.exceptions = 4.6
zope.interface = 5.4.0
zope.testing = 4.7
zope.testrunner = 5.2
zc.zdaemonrecipe = 1.0.0
zc.recipe.deployment = 1.3.0
WebOb = 1.8.9
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