Commit 7c43a19f authored by Jérome Perrin's avatar Jérome Perrin

software/slapos-testing: use nxdtest WIP

parent 0150e946
Pipeline #12042 failed with stage
in 0 seconds
...@@ -15,4 +15,4 @@ ...@@ -15,4 +15,4 @@
[template] [template]
filename = instance.cfg filename = instance.cfg
md5sum = a04806bdebd611c7f6698b4bef7af70d md5sum = 85c8a91bd83e1a54bf48f5ab27dd3daa
[buildout] [buildout]
extends = ${nxdtest-instance.cfg:rendered}
parts = parts =
phantomjs-wrapper runTestSuite
slapos-test-runner
eggs-directory = ${buildout:eggs-directory} eggs-directory = ${buildout:eggs-directory}
develop-eggs-directory = ${buildout:develop-eggs-directory} develop-eggs-directory = ${buildout:develop-eggs-directory}
...@@ -21,6 +21,9 @@ bin = $${buildout:directory}/bin ...@@ -21,6 +21,9 @@ bin = $${buildout:directory}/bin
etc = $${buildout:directory}/etc etc = $${buildout:directory}/etc
services = $${:etc}/run services = $${:etc}/run
srv = $${buildout:directory}/srv srv = $${buildout:directory}/srv
var = $${buildout:directory}/var
nxdtest-working-dir = $${:var}/nxdtest
[download-source] [download-source]
recipe = slapos.recipe.build:gitclone recipe = slapos.recipe.build:gitclone
...@@ -71,30 +74,45 @@ repository = ${slapos.toolbox-repository:location} ...@@ -71,30 +74,45 @@ repository = ${slapos.toolbox-repository:location}
repository = ${slapos.rebootstrap-repository:location} repository = ${slapos.rebootstrap-repository:location}
[slapos-test-runner] [slapos-test-runner-nxdtest-environment.sh]
recipe = slapos.cookbook:wrapper recipe = slapos.recipe.template:jinja2
wrapper-path = $${create-directory:bin}/runTestSuite rendered = $${create-directory:etc}/$${:_buildout_section_name_}
command-line = template = inline:
${buildout:bin-directory}/runTestSuite export PATH=${coreutils:location}/bin:${curl:location}/bin:${openssl:location}/bin:${git:location}/bin:${libxslt:location}/bin:${socat:location}/bin:${lmsensors:location}/bin:${rsync:location}/bin/:${buildout:bin-directory}:$PATH
--python_interpreter=${buildout:bin-directory}/${eggs:interpreter} export SLAPOS_TEST_IPV4=$${slap-configuration:ipv4-random}
--source_code_path_list=$${kedifa:location},$${caucase:location},$${erp5.util:location},$${slapos.cookbook:location},$${slapos.core:location},$${slapos.recipe.build:location},$${slapos.recipe.cmmi:location},$${slapos.recipe.template:location},$${slapos.toolbox:location},$${slapos.libnetworkcache:location},$${slapos.rebootstrap:location} export SLAPOS_TEST_IPV6=$${slap-configuration:ipv6-random}
# Notes about environment:
# * slapos.cookbook:wrapper does not seem to allow "extending" PATH. Tests [slapos-test-runner-dot-nxdtest]
# needs ping, which is a setuid binary that cannot be installed via slapos recipe = slapos.recipe.template:jinja2
# way of building software without root access, so we keep "standard" rendered = $${:workdir}/.nxdtest
# /usr/bin and /bin in $PATH workdir = $${create-directory:nxdtest-working-dir}
# * SLAPOS_TEST_environment is safe to be used by tests, but there is no template = inline:
# guarantee about free ports on IPV4 and IPV6 {% for test in tests.splitlines() %}
# * LOCAL_IPV4 is backward compatible, to be migrated, SLAPOS_TEST_IPV4 # TODO: wrong summary ?
environment = # TODO: include .nxdtest from tested repository ?
PATH=${coreutils:location}/bin:${curl:location}/bin:${openssl:location}/bin:${git:location}/bin:${libxslt:location}/bin:${socat:location}/bin:${lmsensors:location}/bin:${rsync:location}/bin/:${buildout:bin-directory}:/usr/bin/:/bin/ # if we want for some repositories to have more complex
LOCAL_IPV4=$${slap-configuration:ipv4-random} # test scenarios (run linter, etc) way may want to define this
SLAPOS_TEST_IPV4=$${slap-configuration:ipv4-random} # with a .nxdtest file in this repository and not here in a central place ?
SLAPOS_TEST_IPV6=$${slap-configuration:ipv6-random} # XXX debug: {{ test }}
TestCase( """{{ test.split()[0] }}""", [ 'python', '-m', 'unittest', '--', 'discover'], cwd="""{{ test.split()[1] }}""", summaryf=PyTest.summary)
{% endfor %}
[phantomjs-wrapper]
recipe = slapos.cookbook:wrapper context =
command-line = ${phantomjs:location}/phantomjs-slapos key tests :tests
wrapper-path = $${create-directory:bin}/phantomjs tests =
kedifa $${kedifa:location}
caucase $${caucase:location}
erp5.util $${erp5.util:location}
slapos.cookbook $${slapos.cookbook:location}
slapos.core $${slapos.core:location}
slapos.recipe.build $${slapos.recipe.build:location}
slapos.recipe.cmmi $${slapos.recipe.cmmi:location}
slapos.recipe.template $${slapos.recipe.template:location}
slapos.toolbox $${slapos.toolbox:location}
slapos.libnetworkcache $${slapos.libnetworkcache:location}
slapos.rebootstrap $${slapos.rebootstrap:location}
[runTestSuite]
env.sh = $${slapos-test-runner-nxdtest-environment.sh:rendered}
workdir = $${slapos-test-runner-dot-nxdtest:workdir}
...@@ -14,6 +14,7 @@ extends = ...@@ -14,6 +14,7 @@ extends =
../../component/lmsensors/buildout.cfg ../../component/lmsensors/buildout.cfg
../../component/rsync/buildout.cfg ../../component/rsync/buildout.cfg
../../stack/slapos.cfg ../../stack/slapos.cfg
../../stack/nxdtest.cfg
./buildout.hash.cfg ./buildout.hash.cfg
parts = parts =
...@@ -120,14 +121,11 @@ eggs = ...@@ -120,14 +121,11 @@ eggs =
${slapos.rebootstrap-setup:egg} ${slapos.rebootstrap-setup:egg}
zope.testing zope.testing
supervisor supervisor
entry-points =
runTestSuite=erp5.util.testsuite:runTestSuite
scripts = scripts =
runTestSuite
slapos slapos
supervisord supervisord
interpreter= interpreter =
python_for_test python
[git-clone-repository] [git-clone-repository]
recipe = slapos.recipe.build:gitclone recipe = slapos.recipe.build:gitclone
......
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