diff --git a/SAS/TMSS/src/tmss/settings.py b/SAS/TMSS/src/tmss/settings.py index 2598ca61a464613bdcfb54e90507c2f05b4690f7..f22c76093073d7c26f2f80c4e2c6150a75690186 100644 --- a/SAS/TMSS/src/tmss/settings.py +++ b/SAS/TMSS/src/tmss/settings.py @@ -92,10 +92,7 @@ INSTALLED_APPS = [ 'drf_yasg', 'django_filters', 'material', - 'material.frontend', - 'viewflow', - 'viewflow.frontend', - 'lofar.sas.tmss.tmss.workflowapp', + 'material.frontend' ] MIDDLEWARE = [ @@ -117,6 +114,11 @@ if show_debug_toolbar(): INSTALLED_APPS.append('debug_toolbar') MIDDLEWARE.insert(MIDDLEWARE.index('django.middleware.gzip.GZipMiddleware')+1, 'debug_toolbar.middleware.DebugToolbarMiddleware') + +if bool(os.environ.get('TMSS_ENABLE_VIEWFLOW', False)): + INSTALLED_APPS.extend(['viewflow', 'viewflow.frontend', 'lofar.sas.tmss.tmss.workflowapp']) + + ROOT_URLCONF = 'lofar.sas.tmss.tmss.urls' TEMPLATES = [ diff --git a/SAS/TMSS/src/tmss/urls.py b/SAS/TMSS/src/tmss/urls.py index 1b2b5898c5ac20633d63bb3edac9d713f0ecd421..7e722d4cc217facbec5652268593c7946b457ebe 100644 --- a/SAS/TMSS/src/tmss/urls.py +++ b/SAS/TMSS/src/tmss/urls.py @@ -31,7 +31,6 @@ from drf_yasg import openapi from datetime import datetime import os from material.frontend import urls as frontend_urls -from viewflow.flow.viewset import FlowViewSet # diff --git a/SAS/TMSS/test/test_utils.py b/SAS/TMSS/test/test_utils.py index 658e74dcffb1e1c7b0d364ec0c70d66d4336ebf2..5463e36411e156a9fe345797f164b8a527c661bc 100644 --- a/SAS/TMSS/test/test_utils.py +++ b/SAS/TMSS/test/test_utils.py @@ -271,7 +271,8 @@ class TMSSTestEnvironment: exchange: str=os.environ.get("TMSS_EXCHANGE", DEFAULT_BUSNAME), broker: str=os.environ.get("TMSS_BROKER", DEFAULT_BROKER), populate_schemas:bool=False, populate_test_data:bool=False, start_ra_test_environment: bool=False, start_pg_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): self._exchange = exchange self._broker = broker self._populate_schemas = populate_schemas @@ -298,6 +299,9 @@ class TMSSTestEnvironment: self._start_dynamic_scheduler = start_dynamic_scheduler self.dynamic_scheduler = None + if enable_viewflow: + os.environ['TMSS_ENABLE_VIEWFLOW'] = 'True' + # Check for correct Django version, should be at least 3.0 if django.VERSION[0] < 3: print("\nWARNING: YOU ARE USING DJANGO VERSION '%s', WHICH WILL NOT SUPPORT ALL FEATURES IN TMSS!\n" % @@ -451,6 +455,7 @@ def main_test_environment(): group.add_option('-d', '--data', dest='data', action='store_true', help='populate the test-database with test/example data') group.add_option('-s', '--schemas', dest='schemas', action='store_true', help='populate the test-database with the TMSS JSON schemas') group.add_option('-S', '--services', dest='services', action='store_true', help='start the TMSS background services.') + group.add_option('-v', '--viewflow', dest='viewflow', action='store_true', help='Enable the viewflow app for workflows on top of TMSS') group = OptionGroup(parser, 'Messaging options') parser.add_option_group(group) @@ -465,7 +470,8 @@ def main_test_environment(): exchange=options.exchange, broker=options.broker, populate_schemas=options.schemas, populate_test_data=options.data, start_ra_test_environment=options.services, start_pg_listener=options.services, - start_subtask_scheduler=options.services, start_dynamic_scheduler=options.services) as tmss_test_env: + start_subtask_scheduler=options.services, start_dynamic_scheduler=options.services, + enable_viewflow=options.viewflow) as tmss_test_env: # print some nice info for the user to use the test servers... # use print instead of log for clean lines.