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