From 4192ee019ab9b993816166ad149e2df790d58ba3 Mon Sep 17 00:00:00 2001 From: gifrerenom <lluis.gifre@cttc.es> Date: Tue, 18 Feb 2025 12:04:24 +0000 Subject: [PATCH] NBI component: - Fix CI/CD pipeline --- manifests/nbiservice.yaml | 2 +- src/nbi/service/app.py | 6 +++--- src/tests/ofc22/tests/test_functional_create_service.py | 1 + 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/manifests/nbiservice.yaml b/manifests/nbiservice.yaml index 7725cb501..4fcbb81d0 100644 --- a/manifests/nbiservice.yaml +++ b/manifests/nbiservice.yaml @@ -39,7 +39,7 @@ spec: #- containerPort: 9192 env: - name: LOG_LEVEL - value: "INFO" + value: "DEBUG" - name: FLASK_ENV value: "production" # change to "development" if developing - name: IETF_NETWORK_RENDERER diff --git a/src/nbi/service/app.py b/src/nbi/service/app.py index c615584b5..94a267bc6 100644 --- a/src/nbi/service/app.py +++ b/src/nbi/service/app.py @@ -55,9 +55,7 @@ wait_for_environment_variables([ get_env_var_name(ServiceNameEnum.SERVICE, ENVVAR_SUFIX_SERVICE_PORT_GRPC), ]) -BIND_ADDRESS = get_http_bind_address() -BIND_PORT = get_service_port_http(ServiceNameEnum.NBI) -BASE_URL = get_service_baseurl_http(ServiceNameEnum.NBI) or '' +BASE_URL = get_service_baseurl_http(ServiceNameEnum.NBI) or '' nbi_app = NbiApplication(base_url=BASE_URL) register_health_probes(nbi_app) @@ -79,6 +77,8 @@ app = nbi_app.get_flask_app() if __name__ == '__main__': # Only used to run it locally during development stage; # otherwise, app is directly launched by gunicorn. + BIND_ADDRESS = get_http_bind_address() + BIND_PORT = get_service_port_http(ServiceNameEnum.NBI) nbi_app._sio.run( app, host=BIND_ADDRESS, port=BIND_PORT, debug=True, use_reloader=False diff --git a/src/tests/ofc22/tests/test_functional_create_service.py b/src/tests/ofc22/tests/test_functional_create_service.py index e0874a22d..143f662f1 100644 --- a/src/tests/ofc22/tests/test_functional_create_service.py +++ b/src/tests/ofc22/tests/test_functional_create_service.py @@ -78,6 +78,7 @@ def test_scenario_kpi_values_created( We short k KPI descriptors to test. """ response = monitoring_client.GetKpiDescriptorList(Empty()) + assert len(response.kpi_descriptor_list) >= 2 kpi_descriptors = random.choices(response.kpi_descriptor_list, k=2) for kpi_descriptor in kpi_descriptors: -- GitLab