Skip to content
Snippets Groups Projects
Commit e4fd2bd3 authored by Jorrit Schaap's avatar Jorrit Schaap
Browse files

TMSS-917: fixed tests

parent b607cc62
No related branches found
No related tags found
2 merge requests!634WIP: COBALT commissioning delta,!540TMSS-917: primary subtask
......@@ -563,8 +563,9 @@ class TestQAService(unittest.TestCase):
self.tmss_test_env.client_credentials.dbcreds.password))
# create a observation and output dataproduct etc.
obs_task = tdc.post_data_and_get_response_as_json_object(tdc.TaskBlueprint(), '/task_blueprint/')
obs_subtask_template = tmss_client.get_subtask_template(name="observation control")
obs_subtask = tdc.post_data_and_get_response_as_json_object(tdc.Subtask(specifications_template_url=obs_subtask_template['url']), '/subtask/')
obs_subtask = tdc.post_data_and_get_response_as_json_object(tdc.Subtask(specifications_template_url=obs_subtask_template['url'], task_blueprint_url=obs_task['url'], primary=True), '/subtask/')
obs_subtask_output = tdc.post_data_and_get_response_as_json_object(tdc.SubtaskOutput(subtask_url=obs_subtask['url']), '/subtask_output/')
uv_dataproduct = tdc.post_data_and_get_response_as_json_object(tdc.Dataproduct(filename="my_uv_dataprodcut.MS", directory=self.TEST_DIR, subtask_output_url=obs_subtask_output['url']), '/dataproduct/')
for state in ['defined', 'scheduling', 'scheduled', 'queueing', 'queued', 'starting', 'started', 'finishing', 'finished']:
......@@ -574,7 +575,7 @@ class TestQAService(unittest.TestCase):
qafile_subtask_spec_doc = tmss_client.get_subtask_template_default_specification(name="QA file conversion")
subtask = tdc.post_data_and_get_response_as_json_object(tdc.Subtask(specifications_template_url=qafile_subtask_template['url'],
specifications_doc=qafile_subtask_spec_doc), '/subtask/')
specifications_doc=qafile_subtask_spec_doc, task_blueprint_url=obs_task['url'], primary=False), '/subtask/')
subtask_id = subtask['id']
subtask_input = tdc.post_data_and_get_response_as_json_object(tdc.SubtaskInput(subtask['url'], dataproduct_urls=[uv_dataproduct['url']], subtask_output_url=obs_subtask_output['url']), '/subtask_input/')
......@@ -582,7 +583,7 @@ class TestQAService(unittest.TestCase):
tmss_client.set_subtask_status(subtask_id, 'defined')
# trigger a qa process by setting the tmss subtask to scheduled
# this will result in the QAService actually doing its magic
# this will result in the QAService actually doing its magict_feedback_handling_service
# but first, we need to override where the output dataproduct is written,
# so, stop listening, schedule (getting the default output dataproduct), and then override the directory, and start listening again (picking up the scheduled-event).
qaservice.filtering_tmssbuslistener.stop_listening()
......@@ -618,7 +619,7 @@ class TestQAService(unittest.TestCase):
self.assertTrue('hdf5_file_path' in qa_listener.clustered_msg_content)
subtask2 = tdc.post_data_and_get_response_as_json_object(tdc.Subtask(specifications_template_url=qaplots_subtask_template['url'],
specifications_doc=qaplots_subtask_spec_doc), '/subtask/')
specifications_doc=qaplots_subtask_spec_doc, task_blueprint_url=obs_task['url'], primary=False), '/subtask/')
tdc.post_data_and_get_response_as_json_object(tdc.SubtaskInput(subtask2['url'], dataproduct_urls=[dataproduct['url']], subtask_output_url=subtask_output['url']), '/subtask_input/')
subtask2_output = tdc.post_data_and_get_response_as_json_object(tdc.SubtaskOutput(subtask2['url']), '/subtask_output/')
subtask2_id = subtask2['id']
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment