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

TMSS-190: and TMSS-388: only enable viewflow if TMSS_ENABLE_VIEWFLOW envvar is...

TMSS-190: and TMSS-388: only enable viewflow if TMSS_ENABLE_VIEWFLOW envvar is set, or if --viewflow option is given
parent 3345c0bd
No related branches found
No related tags found
1 merge request!252Resolve TMSS-190
...@@ -92,10 +92,7 @@ INSTALLED_APPS = [ ...@@ -92,10 +92,7 @@ INSTALLED_APPS = [
'drf_yasg', 'drf_yasg',
'django_filters', 'django_filters',
'material', 'material',
'material.frontend', 'material.frontend'
'viewflow',
'viewflow.frontend',
'lofar.sas.tmss.tmss.workflowapp',
] ]
MIDDLEWARE = [ MIDDLEWARE = [
...@@ -117,6 +114,11 @@ if show_debug_toolbar(): ...@@ -117,6 +114,11 @@ if show_debug_toolbar():
INSTALLED_APPS.append('debug_toolbar') INSTALLED_APPS.append('debug_toolbar')
MIDDLEWARE.insert(MIDDLEWARE.index('django.middleware.gzip.GZipMiddleware')+1, 'debug_toolbar.middleware.DebugToolbarMiddleware') 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' ROOT_URLCONF = 'lofar.sas.tmss.tmss.urls'
TEMPLATES = [ TEMPLATES = [
......
...@@ -31,7 +31,6 @@ from drf_yasg import openapi ...@@ -31,7 +31,6 @@ from drf_yasg import openapi
from datetime import datetime from datetime import datetime
import os import os
from material.frontend import urls as frontend_urls from material.frontend import urls as frontend_urls
from viewflow.flow.viewset import FlowViewSet
# #
......
...@@ -271,7 +271,8 @@ class TMSSTestEnvironment: ...@@ -271,7 +271,8 @@ class TMSSTestEnvironment:
exchange: str=os.environ.get("TMSS_EXCHANGE", DEFAULT_BUSNAME), broker: str=os.environ.get("TMSS_BROKER", DEFAULT_BROKER), 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, populate_schemas:bool=False, populate_test_data:bool=False,
start_ra_test_environment: bool=False, start_pg_listener: 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._exchange = exchange
self._broker = broker self._broker = broker
self._populate_schemas = populate_schemas self._populate_schemas = populate_schemas
...@@ -298,6 +299,9 @@ class TMSSTestEnvironment: ...@@ -298,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
if enable_viewflow:
os.environ['TMSS_ENABLE_VIEWFLOW'] = 'True'
# Check for correct Django version, should be at least 3.0 # Check for correct Django version, should be at least 3.0
if django.VERSION[0] < 3: if django.VERSION[0] < 3:
print("\nWARNING: YOU ARE USING DJANGO VERSION '%s', WHICH WILL NOT SUPPORT ALL FEATURES IN TMSS!\n" % 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(): ...@@ -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('-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', '--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('-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') group = OptionGroup(parser, 'Messaging options')
parser.add_option_group(group) parser.add_option_group(group)
...@@ -465,7 +470,8 @@ def main_test_environment(): ...@@ -465,7 +470,8 @@ def main_test_environment():
exchange=options.exchange, broker=options.broker, exchange=options.exchange, broker=options.broker,
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_pg_listener=options.services, 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... # 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.
Please register or to comment