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

TMSS-190: added pipelinecontrol as background service for tmsstestenv

parent 123e21b5
No related branches found
No related tags found
1 merge request!252Resolve TMSS-190
...@@ -272,7 +272,7 @@ class TMSSTestEnvironment: ...@@ -272,7 +272,7 @@ class TMSSTestEnvironment:
populate_schemas:bool=False, populate_test_data:bool=False, populate_schemas:bool=False, populate_test_data:bool=False,
start_ra_test_environment: bool=False, start_postgres_listener: bool=False, start_ra_test_environment: bool=False, start_postgres_listener: bool=False,
start_subtask_scheduler: bool=False, start_dynamic_scheduler: bool=False, start_subtask_scheduler: bool=False, start_dynamic_scheduler: bool=False,
enable_viewflow: bool=False): start_pipeline_control: bool=False, enable_viewflow: bool=False):
self._exchange = exchange self._exchange = exchange
self._broker = broker self._broker = broker
self._populate_schemas = populate_schemas self._populate_schemas = populate_schemas
...@@ -299,6 +299,9 @@ class TMSSTestEnvironment: ...@@ -299,6 +299,9 @@ class TMSSTestEnvironment:
self._start_dynamic_scheduler = start_dynamic_scheduler self._start_dynamic_scheduler = start_dynamic_scheduler
self.dynamic_scheduler = None self.dynamic_scheduler = None
self._start_pipeline_control = start_pipeline_control
self.pipeline_control = None
if enable_viewflow: if enable_viewflow:
os.environ['TMSS_ENABLE_VIEWFLOW'] = 'True' os.environ['TMSS_ENABLE_VIEWFLOW'] = 'True'
...@@ -353,6 +356,11 @@ class TMSSTestEnvironment: ...@@ -353,6 +356,11 @@ class TMSSTestEnvironment:
self.dynamic_scheduler = create_dynamic_scheduling_service(exchange=self._exchange, broker=self._broker) self.dynamic_scheduler = create_dynamic_scheduling_service(exchange=self._exchange, broker=self._broker)
self.dynamic_scheduler.start_listening() self.dynamic_scheduler.start_listening()
if self._start_pipeline_control:
from lofar.mac.PipelineControl import PipelineControlTMSS
self.pipeline_control = PipelineControlTMSS(exchange=self._exchange, broker=self._broker)
self.pipeline_control.start_listening()
if self._populate_schemas or self._populate_test_data: if self._populate_schemas or self._populate_test_data:
self.populate_schemas() self.populate_schemas()
...@@ -373,6 +381,10 @@ class TMSSTestEnvironment: ...@@ -373,6 +381,10 @@ class TMSSTestEnvironment:
self.dynamic_scheduler.stop_listening() self.dynamic_scheduler.stop_listening()
self.dynamic_scheduler = None self.dynamic_scheduler = None
if self.pipeline_control is not None:
self.pipeline_control.stop_listening()
self.pipeline_control = None
if self.ra_test_environment is not None: if self.ra_test_environment is not None:
self.ra_test_environment.stop() self.ra_test_environment.stop()
self.ra_test_environment = None self.ra_test_environment = None
...@@ -471,7 +483,7 @@ def main_test_environment(): ...@@ -471,7 +483,7 @@ def main_test_environment():
populate_schemas=options.schemas, populate_test_data=options.data, populate_schemas=options.schemas, populate_test_data=options.data,
start_ra_test_environment=options.services, start_postgres_listener=options.services, start_ra_test_environment=options.services, start_postgres_listener=options.services,
start_subtask_scheduler=options.services, start_dynamic_scheduler=options.services, start_subtask_scheduler=options.services, start_dynamic_scheduler=options.services,
enable_viewflow=options.viewflow) as tmss_test_env: start_pipeline_control=options.services, enable_viewflow=options.viewflow) as tmss_test_env:
# print some nice info for the user to use the test servers... # print some nice info for the user to use the test servers...
# use print instead of log for clean lines. # use print instead of log for clean lines.
......
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