From be361659f3ff9120fd4fb9ecf3e3243fee09ad03 Mon Sep 17 00:00:00 2001 From: vladislavploaia Date: Thu, 8 Feb 2024 11:28:07 +0200 Subject: [PATCH] fix: align get_variables() from main branch --- .../variables/get_global_configs.py | 22 +++++++++++-------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/tests/robot/_resources/variables/get_global_configs.py b/tests/robot/_resources/variables/get_global_configs.py index a9b6423b..c3a4f057 100644 --- a/tests/robot/_resources/variables/get_global_configs.py +++ b/tests/robot/_resources/variables/get_global_configs.py @@ -1,17 +1,21 @@ import yaml +import os + def get_variables(): with open('robot/_resources/variables/additional_configs.yml', 'r') as file: yaml_content = yaml.safe_load(file) port = yaml_content['GLOBAL_PORT'] + ehrbase_baseurl = os.environ.get('EHRBASE_BASE_URL', f'http://localhost:{port}') json_obj = \ { - "GLOBAL_PORT":port, - "BASEURL": f'http://localhost:{port}/ehrbase/rest/openehr/v1', - "ECISURL": f'http://localhost:{port}/ehrbase/rest/ecis/v1', - "ADMIN_BASEURL": f'http://localhost:{port}/ehrbase/rest/admin', - "HEARTBEAT_URL": f'http://localhost:{port}/ehrbase/rest/status', - "PLUGIN_URL": f'http://localhost:{port}/ehrbase/plugin', - "RABBITMQ_URL": "http://127.0.0.1:15672/api" - } - return json_obj + "GLOBAL_PORT": port, + "BASEURL": os.environ.get('BASEURL', f'{ehrbase_baseurl}/ehrbase/rest/openehr/v1'), + "ECISURL": os.environ.get('ECISURL', f'{ehrbase_baseurl}/ehrbase/rest/ecis/v1'), + "ADMIN_BASEURL": os.environ.get('ADMIN_BASEURL', f'{ehrbase_baseurl}/ehrbase/rest/admin'), + "HEARTBEAT_URL": os.environ.get('HEARTBEAT_URL', f'{ehrbase_baseurl}/ehrbase/rest/status'), + "PLUGIN_URL": os.environ.get('PLUGIN_URL', f'{ehrbase_baseurl}/ehrbase/plugin'), + "RABBITMQ_URL": os.environ.get('RABBITMQ_URL', "http://127.0.0.1:15672/api"), + "KAFKA_URL": os.environ.get('KAFKA_URL', "http://127.0.0.1:8082") + } + return json_obj \ No newline at end of file