Commit cb6a12e0 authored by Priscila Manhaes's avatar Priscila Manhaes

Refactor for runnig cloudooo tests

parent 5c38aaa1
...@@ -181,18 +181,20 @@ branch = %(branch)s ...@@ -181,18 +181,20 @@ branch = %(branch)s
test_result_path, status_dict, config['test_node_title']) test_result_path, status_dict, config['test_node_title'])
retry_software = True retry_software = True
continue continue
# create instances, it should take some seconds only # create instances, it should take some seconds only
slapos_controler.runComputerPartition(config, slapos_controler.runComputerPartition(config,
process_group_pid_set=process_group_pid_set) process_group_pid_set=process_group_pid_set)
partition_path = os.path.join(config['instance_root'], partition_path = os.path.join(config['instance_root'],
config['partition_reference']) config['partition_reference'])
run_test_suite_path = os.path.join(partition_path, 'bin', run_test_suite_path = os.path.join(partition_path, 'bin',
'runCloudoooUnitTest') 'runCloudoooUnitTest')
if not os.path.exists(run_test_suite_path): if not os.path.exists(run_test_suite_path):
raise ValueError('No %r provided' % run_test_suite_path) raise ValueError('No %r provided' % run_test_suite_path)
cloudooo_paster = os.path.join(partition_path, 'bin',
'cloudooo_paster')
cloudooo_conf = os.path.join(partition_path, 'etc',
'conversion_server.cfg')
run_test_suite_revision = revision run_test_suite_revision = revision
if isinstance(revision, tuple): if isinstance(revision, tuple):
...@@ -201,15 +203,17 @@ branch = %(branch)s ...@@ -201,15 +203,17 @@ branch = %(branch)s
file_object = open(run_test_suite_path, 'r') file_object = open(run_test_suite_path, 'r')
line = file_object.readline() line = file_object.readline()
file_object.close() file_object.close()
# cloudooo_tests = glob(
# '%s/*/src/cloudooo/cloudooo/handler/*/tests/test*.py' %
# config['software_root'])
# for test in cloudooo_tests:
invocation_list = [] invocation_list = []
if line[:2] == '#!': if line[:2] == '#!':
invocation_list = line[2:].split() invocation_list = line[2:].split()
invocation_list.extend([run_test_suite_path, invocation_list.extend([run_test_suite_path,
'--test_suite', config['test_suite'], '--paster_path', cloudooo_paster,
'--revision', revision, cloudooo_conf,
'--test_suite_title', test_suite_title, 'testFfmpegServer'])
'--node_quantity', config['node_quantity'],
'--master_url', config['test_suite_master_url']])
run_test_suite = subprocess.Popen(invocation_list) run_test_suite = subprocess.Popen(invocation_list)
process_group_pid_set.add(run_test_suite.pid) process_group_pid_set.add(run_test_suite.pid)
run_test_suite.wait() run_test_suite.wait()
......
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