diff --git a/setup.py b/setup.py index 6d87dfab35d45e3bd0b0d7a8539ed51c32cb3bdd..1b5c2a0a0db1ea6c26ecb137ffe4bf52842d73e3 100755 --- a/setup.py +++ b/setup.py @@ -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', diff --git a/slapos/recipe/erp5_test/__init__.py b/slapos/recipe/erp5_test/__init__.py index 6d9166580bf0a6c7b48ca169099e32bdccd6ba54..be2776e3a38a4f2614c169a76e30145f7fa8d7e4 100644 --- a/slapos/recipe/erp5_test/__init__.py +++ b/slapos/recipe/erp5_test/__init__.py @@ -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 + diff --git a/software/slapos-testing/instance.cfg b/software/slapos-testing/instance.cfg new file mode 100644 index 0000000000000000000000000000000000000000..a909c581bf24b44e737afe620b170bb693183248 --- /dev/null +++ b/software/slapos-testing/instance.cfg @@ -0,0 +1,24 @@ +[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 diff --git a/software/slapos-testing/software.cfg b/software/slapos-testing/software.cfg new file mode 100644 index 0000000000000000000000000000000000000000..bda586dd0dbc3f6988d49706e4c35e9711cb4adf --- /dev/null +++ b/software/slapos-testing/software.cfg @@ -0,0 +1,44 @@ + +[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 +