Commit a12cd57d authored by Boxiang Sun's avatar Boxiang Sun

erp5testnode: Use nxdtest in depoy-test

parent bbd44c6d
......@@ -18,4 +18,4 @@ md5sum = 8357771b70efd0740561b1cb46f6955e
[template-deploy-test]
filename = instance.cfg.in
md5sum = c5db797980951b764b69aaa4b60a0380
# md5sum = c5db797980951b764b69aaa4b60a0380
......@@ -11,7 +11,6 @@
The test_type = "{{ test_type }}" is unsupported.
{% endif -%}
[buildout]
eggs-directory = {{ eggs_directory }}
develop-eggs-directory = {{ develop_eggs_directory }}
offline = true
......@@ -69,3 +68,5 @@ tmp = ${:home}/tmp/
log = ${:var}/log/
services = ${:etc}/service/
scripts = ${:etc}/run/
test-working-dir = ${:home}/tmp
nxdtest-working-dir = ${:var}/nxdtest
\ No newline at end of file
[buildout]
extends = ${template:output}
extends =
${nxdtest-instance.cfg:output}
${template:output}
parts +=
runTestSuite
copy-test-data
publish
[copy-test-data]
# Note: This is a hack, as such while requesting KVM it is not possible
......@@ -23,17 +26,29 @@ command =
cp ${standalone-local-playbook:location} $dest/standalone-local-playbook
fi
[runTestSuite]
[deploy-test-nxdtest-environment.sh]
recipe = slapos.recipe.template:jinja2
rendered = $${buildout:directory}/bin/$${:_buildout_section_name_}
rendered = $${buildout:directory}/etc/${:_buildout_section_name_}
template = inline:
#!/bin/sh
export PATH=${python2.7-with-eggs:location}:$PATH
exec ${buildout:bin-directory}/${runTestSuite_py:interpreter} ${:_profile_base_location_}/runTestSuite.py --partition_ipv4 {{ list(partition_ipv4)[0] }} --partition_path $${buildout:directory} --test_reference "{{ slapparameter_dict.get('image-to-test-url') }} {{ slapparameter_dict.get('script-to-test-url')}}" --test_location "${test-location:base}/{{ slapparameter_dict.get('test-relative-directory', 'playbook/roles/standalone-shared') }}" --python_interpreter=${buildout:bin-directory}/${runTestSuite_py:interpreter} "$@"
mode = 0755
context =
key slapparameter_dict slap-configuration:configuration
key partition_ipv4 slap-configuration:ipv4
export PATH=$${buildout:bin-directory}:/usr/bin/:/bin
export SLAPOS_TEST_WORKING_DIR=$${buildout:directory}/tmp
export SLAPOS_TEST_LOG_DIRECTORY=$${buildout:directory}/var/log
[deploy-test-dot-nxdtest]
recipe = slapos.recipe.template:jinja2
rendered = $${buildout:directory}/var/nxdtest/.nxdtest
workdir = $${buildout:directory}/var/nxdtest
template = inline:
TestCase(
"deploy-test",
['python', '-m', 'unittest', 'discover', '-v'],
cwd="""$${buildout:directory}/test""",
summaryf=UnitTest.summary,
)
[runTestSuite]
env.sh = $${deploy-test-nxdtest-environment.sh:rendered}
workdir = $${deploy-test-dot-nxdtest:workdir}
[switch_softwaretype]
default = $${:deploy-test}
......@@ -53,3 +68,18 @@ context =
raw waittime ${deploy-script-controller-script:waittime}
raw tries ${deploy-script-controller-script:tries}
mode = 0644
[slapos-local-development-environment.sh]
recipe = slapos.recipe.template:jinja2
rendered = ${buildout:directory}/etc/${:_buildout_section_name_}
template = inline:
source $${deploy-test-nxdtest-environment.sh:rendered}
echo "Environment loaded."
echo "To work on a test, execute:"
echo " $${runTestSuite:wrapper-path} -k test_name"
echo "replacing test_name by the name of the test."
echo
[publish]
recipe = slapos.cookbook:publish
environment-script = $${slapos-local-development-environment.sh:rendered}
......@@ -2,18 +2,12 @@
extends =
buildout.hash.cfg
https://lab.nexedi.com/nexedi/slapos/raw/1.0.232/software/kvm/software.cfg
../../../../stack/nxdtest.cfg
parts =
python-with-eggs
template-deploy-test
runTestSuite_py
playbook
[runTestSuite_py]
recipe = zc.recipe.egg
eggs =
erp5.util
interpreter = ${:_buildout_section_name_}
[python2.7-with-eggs]
# create interpreters named "python" and "python2.7" so that
# instance profile can use them in $PATH
......@@ -69,4 +63,4 @@ location = ${:_profile_base_location_}/${:filename}
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/${:filename}
output = ${buildout:directory}/template.cfg
mode = 0644
mode = 640
\ No newline at end of file
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