Commit e2b2d583 authored by Julien Muchembled's avatar Julien Muchembled

rina: fix buildout path (test suites are already run in a dedicated folder)

parent e7976887
#!{{parameter_dict['runTestSuite_py']}} #!{{parameter_dict['runTestSuite_py']}}
from __future__ import print_function from __future__ import print_function
import argparse, errno, os, shutil, subprocess, sys, traceback import argparse, os, subprocess, sys, traceback
from time import gmtime, strftime, time from time import gmtime, strftime, time
# These are the 2 modules to reuse when using ERP5 for managing test bots. # These are the 2 modules to reuse when using ERP5 for managing test bots.
# What we do here is currently too new to reuse more from testsuite. # What we do here is currently too new to reuse more from testsuite.
...@@ -12,9 +12,6 @@ from erp5.util.testsuite import format_command ...@@ -12,9 +12,6 @@ from erp5.util.testsuite import format_command
dist_list = {{vm['dists'].split()}} dist_list = {{vm['dists'].split()}}
publish = {{slapparameter_dict.get('publish')}} publish = {{slapparameter_dict.get('publish')}}
BUILDDIR = 'build'
BUILDOUT = os.path.realpath(os.path.join('software_release', 'bin', 'buildout'))
STAT_MAP = dict( STAT_MAP = dict(
TOTAL = 'test_count', TOTAL = 'test_count',
PASS = None, PASS = None,
...@@ -82,14 +79,9 @@ def main(): ...@@ -82,14 +79,9 @@ def main():
else: else:
test_result = DummyTestResult(dist_list) test_result = DummyTestResult(dist_list)
if os.path.exists(BUILDDIR): fd = os.open('buildout.cfg', os.O_CREAT | os.O_EXCL | os.O_WRONLY, 0666)
shutil.rmtree(BUILDDIR) try:
os.mkdir(BUILDDIR) os.write(fd, """\
oldpwd = os.getcwd()
os.chdir(BUILDDIR)
with open('buildout.cfg', 'w') as f:
f.write("""\
[buildout] [buildout]
extends = {{parameter_dict['profile_base_location']}}/build.cfg extends = {{parameter_dict['profile_base_location']}}/build.cfg
offline = true offline = true
...@@ -106,6 +98,8 @@ location = {{parameter_dict['rina_tools']}} ...@@ -106,6 +98,8 @@ location = {{parameter_dict['rina_tools']}}
[slapos.package-repository] [slapos.package-repository]
location = {{parameter_dict['slapos_package']}} location = {{parameter_dict['slapos_package']}}
""") """)
finally:
os.close(fd)
librina_log = os.path.join('parts', 'debuild-librina', 'build.log') librina_log = os.path.join('parts', 'debuild-librina', 'build.log')
stderr_write = sys.stderr.write stderr_write = sys.stderr.write
...@@ -115,7 +109,7 @@ location = {{parameter_dict['slapos_package']}} ...@@ -115,7 +109,7 @@ location = {{parameter_dict['slapos_package']}}
break break
dist = test_result_line.name dist = test_result_line.name
cmd = [BUILDOUT, cmd = [{{repr(parameter_dict['buildout'])}},
'vm-run-base:dist=' + dist, 'vm-run-base:dist=' + dist,
'debuild-rina-base:suite=' + (publish['suite'] if publish else ''), 'debuild-rina-base:suite=' + (publish['suite'] if publish else ''),
] ]
...@@ -188,10 +182,6 @@ location = {{parameter_dict['slapos_package']}} ...@@ -188,10 +182,6 @@ location = {{parameter_dict['slapos_package']}}
# TODO: upload packages if 'publish' parameter is given # TODO: upload packages if 'publish' parameter is given
if args.master_url:
os.chdir(oldpwd)
shutil.rmtree(BUILDDIR)
if __name__ == "__main__": if __name__ == "__main__":
main() main()
...@@ -39,6 +39,7 @@ template = inline: ...@@ -39,6 +39,7 @@ template = inline:
environment = {{dumps(environment)}} environment = {{dumps(environment)}}
vm = {{dumps(vm)}} vm = {{dumps(vm)}}
runTestSuite_py = ${buildout:bin-directory}/${runTestSuite_py:interpreter} runTestSuite_py = ${buildout:bin-directory}/${runTestSuite_py:interpreter}
buildout = ${buildout:bin-directory}/buildout
profile_base_location = ${:_profile_base_location_} profile_base_location = ${:_profile_base_location_}
rina_tools = ${rina-tools-repository:location} rina_tools = ${rina-tools-repository:location}
slapos_package = ${slapos.package-repository:location} slapos_package = ${slapos.package-repository:location}
......
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