From a11b787eca17fadf1266de9f7d6e37b83c3430f6 Mon Sep 17 00:00:00 2001
From: Jorrit Schaap <schaap@astron.nl>
Date: Mon, 18 Jan 2021 10:10:40 +0100
Subject: [PATCH] TMSS-557: split viewflow option into --viewflow_app and
 --viewflow_service. Run tmss with only --viewflow_app via supervisor. Have a
 seperate viewflow service.

---
 SAS/TMSS/bin/tmss.ini       | 2 +-
 SAS/TMSS/test/test_utils.py | 9 +++++----
 2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/SAS/TMSS/bin/tmss.ini b/SAS/TMSS/bin/tmss.ini
index eb89425dd52..bd171f7b809 100644
--- a/SAS/TMSS/bin/tmss.ini
+++ b/SAS/TMSS/bin/tmss.ini
@@ -1,5 +1,5 @@
 [program:tmss]
-command=/bin/bash -c 'source $LOFARROOT/lofarinit.sh;exec tmss_test_environment --schemas --LDAP_ID=TMSS_testenv_rest --DB_ID=TMSS_testenv_db'
+command=/bin/bash -c 'source $LOFARROOT/lofarinit.sh;exec tmss_test_environment --schemas --viewflow_app --LDAP_ID=TMSS_testenv_rest --DB_ID=TMSS_testenv_db'
 priority=100
 user=lofarsys
 stopsignal=INT ; KeyboardInterrupt
diff --git a/SAS/TMSS/test/test_utils.py b/SAS/TMSS/test/test_utils.py
index 08aa6b7517c..998083535d4 100644
--- a/SAS/TMSS/test/test_utils.py
+++ b/SAS/TMSS/test/test_utils.py
@@ -558,7 +558,8 @@ def main_test_environment():
     group.add_option('-m', '--eventmessages', dest='eventmessages', action='store_true', help='Send event messages over the messagebus for changes in the TMSS database (for (sub)tasks/scheduling_units etc).')
     group.add_option('-r', '--ra_test_environment', dest='ra_test_environment', action='store_true', help='start the Resource Assigner test environment which enables scheduling.')
     group.add_option('-S', '--scheduling', dest='scheduling', action='store_true', help='start the TMSS background scheduling services for dynamic scheduling of schedulingunits and subtask scheduling of chains of dependend subtasks.')
-    group.add_option('-v', '--viewflow', dest='viewflow', action='store_true', help='Enable the viewflow app for workflows on top of TMSS')
+    group.add_option('-v', '--viewflow_app', dest='viewflow_app', action='store_true', help='Enable the viewflow app for workflows on top of TMSS')
+    group.add_option('-V', '--viewflow_service', dest='viewflow_service', action='store_true', help='Enable the viewflow service. Implies --viewflow_app and --eventmessages')
     group.add_option('-w', '--websockets', dest='websockets', action='store_true', help='Enable json updates pushed via websockets')
     group.add_option('-f', '--feedbackservice', dest='feedbackservice', action='store_true', help='Enable feedbackservice to handle feedback from observations/pipelines which comes in via the (old qpid) otdb messagebus.')
     group.add_option('--all', dest='all', action='store_true', help='Enable/Start all the services, upload schemas and testdata')
@@ -591,13 +592,13 @@ def main_test_environment():
                              populate_schemas=options.schemas or options.data or options.all,
                              populate_test_data=options.data or options.all,
                              start_ra_test_environment=options.ra_test_environment or options.all,
-                             start_postgres_listener=options.eventmessages or options.scheduling or options.all,
+                             start_postgres_listener=options.eventmessages or options.scheduling or options.viewflow_service or options.all,
                              start_subtask_scheduler=options.scheduling or options.all,
                              start_dynamic_scheduler=options.scheduling or options.all,
                              start_websocket=options.websockets or options.all,
                              start_feedback_service=options.feedbackservice or options.all,
-                             start_workflow_service=options.viewflow or options.all,
-                             enable_viewflow=options.viewflow or options.all,
+                             enable_viewflow=options.viewflow_app or options.viewflow_service or options.all,
+                             start_workflow_service=options.viewflow_service or options.all,
                              ldap_dbcreds_id=options.LDAP_ID, db_dbcreds_id=options.DB_ID) as tmss_test_env:
 
             # print some nice info for the user to use the test servers...
-- 
GitLab