Commit 8585bdb7 authored by Sebastien Robin's avatar Sebastien Robin

report building failures to the master

parent c764e493
from setuptools import setup, find_packages
name = "erp5.recipe.testnode"
version = '1.0.5'
version = '1.0.11'
def read(name):
return open(name).read()
......
......@@ -56,16 +56,15 @@ class SlapOSControler(object):
slapgrid = subprocess.Popen([config['slapgrid_software_binary'], '-v', '-c',
#'--buildout-parameter',"'-U -N' -o",
config['slapos_config']],
stdout=subprocess.PIPE, stderr=subprocess.PIPE,
close_fds=True, preexec_fn=os.setsid)
process_group_pid_list.append(slapgrid.pid)
slapgrid.wait()
if slapgrid.returncode == 0:
print 'Software installed properly'
break
else:
raise ValueError("Slapgrid software failed")
print 'Problem with software installation, trying again'
time.sleep(600)
stdout, stderr = slapgrid.communicate()
status_dict = {'status_code':slapgrid.returncode,
'stdout':stdout,
'stderr':stderr}
return status_dict
def runComputerPartition(self, config, process_group_pid_list=None):
print "SlapOSControler.runSoftwareRelease"
......
......@@ -73,7 +73,7 @@ class Recipe(BaseSlapRecipe):
ipv4_address=self.getLocalIPv4Address(),
ipv6_address=self.getGlobalIPv6Address(),
master_url=CONFIG['master_url'],
profile_url=self.parameter_dict['profile_url'],
profile_path=self.parameter_dict['profile_path'],
proxy_database=CONFIG['proxy_database'],
proxy_port=CONFIG['proxy_port'],
slapgrid_partition_binary=self.options['slapgrid_partition_binary'],
......@@ -89,8 +89,7 @@ class Recipe(BaseSlapRecipe):
test_suite_master_url=self.parameter_dict.get(
'test_suite_master_url', None),
test_suite_name=self.parameter_dict.get('test_suite_name'),
#slave_name=self.parameter_dict['slave_name'],
#slave_password=self.parameter_dict['slave_password'],
test_suite_title=self.parameter_dict.get('test_suite_title'),
bin_directory=self.bin_directory,
foo='bar',
# botenvironemnt is splittable string of key=value to substitute
......
......@@ -85,7 +85,7 @@ extends = %(software_config_path)s
[%(repository_name)s]
repository = %(repository_path)s
""" % {'software_config_path': os.path.join(repository_path,
config['profile_url']),
config['profile_path']),
'repository_name': repository_name,
'repository_path' : repository_path}
if branch is not None:
......@@ -126,7 +126,7 @@ repository = %(repository_path)s
assert master.getProtocolRevision() == 1
test_result = safeRpcCall(master.createTestResult,
config['test_suite_name'], revision, [],
False)
False, config['test_suite_title'])
print "testnode, test_result : %r" % (test_result,)
if test_result:
test_result_path, test_revision = test_result
......@@ -142,10 +142,14 @@ repository = %(repository_path)s
process_group_pid_list=process_group_pid_list)
if run_software:
# this should be always true later, but it is too slow for now
slapos_controler.runSoftwareRelease(config,
status_dict = slapos_controler.runSoftwareRelease(config,
environment=config['environment'],
process_group_pid_list=process_group_pid_list,
)
if status_dict['status_code'] != 0:
safeRpcCall(master.reportTaskFailure,
test_result_path, status_dict, config['test_suite_title'])
continue
run_software = False
# create instances, it should take some seconds only
......
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