Commit 2295ee12 authored by Rafael Monnerat's avatar Rafael Monnerat

Added initial version of slapos-testing

parent 516022e5
......@@ -67,6 +67,7 @@ setup(name=name,
'helloworld = slapos.recipe.helloworld:Recipe',
'generic.cloudooo = slapos.recipe.generic_cloudooo:Recipe',
'cloudooo.test = slapos.recipe.erp5_test:CloudoooRecipe',
'slap.test = slapos.recipe.erp5_test:SlapUnitTestRecipe',
'firefox = slapos.recipe.firefox:Recipe',
'fontconfig = slapos.recipe.fontconfig:Recipe',
'java = slapos.recipe.java:Recipe',
......
......@@ -98,3 +98,24 @@ class CloudoooRecipe(GenericBaseRecipe):
], **common_dict)]))
return path_list
class SlapUnitTestRecipe(GenericBaseRecipe):
def install(self):
path_list = []
common_dict = dict(
prepend_path=self.options['prepend-path'],
)
common_list = []
run_unit_test_path = self.createPythonScript(self.options['run-unit-test'],
__name__ + '.test.runUnitTest', [dict(
call_list=[self.options['run-unit-test-binary'],
] + common_list, **common_dict)])
path_list.append(run_unit_test_path)
path_list.append(self.createPythonScript(self.options['run-test-suite'],
__name__ + '.test.runTestSuite', [dict(
call_list=[self.options['run-test-suite-binary'],
], **common_dict)]))
return path_list
[buildout]
parts =
slapos-test-runner
eggs-directory = ${buildout:eggs-directory}
develop-eggs-directory = ${buildout:develop-eggs-directory}
offline = true
[slapos-test-runner]
recipe = slapos.cookbook:slapuser.test
run-unit-test = ${buildout:bin-directory}/runUnitTest
run-test-suite = ${buildout:bin-directory}/runTestSuite
configuration-file = ${cloudooo-instance:configuration-file}
run-unit-test-binary =
run-test-suite-binary =
[rootdirectory]
recipe = slapos.cookbook:mkdirectory
etc = ${buildout:directory}/etc
srv = ${buildout:directory}/srv
bin = ${buildout:directory}/bin
[buildout]
extends =
../../component/slapos/buildout.cfg
../../component/git/buildout.cfg
develop =
${:parts-directory}/slapos.core-repository
parts += slapos.core-repository
check-recipe
runTestSuite
[runTestSuite]
recipe =
zc.recipe.testrunner
eggs =
slapos.core
# slapos.core do not use python convention to find the
# tests.
defaults = ['--tests-pattern', '$', '-v']
# Local development
[slapos.core-repository]
recipe = plone.recipe.command
stop-on-error = true
location = ${buildout:parts-directory}/${:_buildout_section_name_}
command = ${git:location}/bin/git clone --quiet http://git.erp5.org/repos/slapos.core.git ${:location}
update-command = cd ${:location} && ${git:location}/bin/git pull --quiet
[check-recipe]
recipe = plone.recipe.command
stop-on-error = true
update-command = ${:command}
command = grep parts ${buildout:develop-eggs-directory}/slapos.core.egg-link
[template]
recipe = slapos.recipe.build:download
url = ${:_profile_base_location_}/instance.cfg
md5sum =
mode = 640
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