Loading scripts/run_tests_locally-analytics-backend.sh +6 −3 Original line number Diff line number Diff line Loading @@ -19,10 +19,13 @@ PROJECTDIR=`pwd` cd $PROJECTDIR/src RCFILE=$PROJECTDIR/coverage/.coveragerc export KFK_SERVER_ADDRESS='127.0.0.1:9092' export KFK_SERVER_ADDRESS='127.0.0.1:9094' CRDB_SQL_ADDRESS=$(kubectl get service cockroachdb-public --namespace crdb -o jsonpath='{.spec.clusterIP}') export CRDB_URI="cockroachdb://tfs:tfs123@${CRDB_SQL_ADDRESS}:26257/tfs_analytics?sslmode=require" python3 -m pytest --log-level=DEBUG --log-cli-level=INFO --verbose \ analytics/backend/tests/test_backend.py # python3 -m pytest --log-level=DEBUG --log-cli-level=INFO --verbose \ # analytics/backend/tests/test_backend.py python3 -m pytest --log-level=DEBUG --log-cli-level=DEBUG --verbose \ analytics/backend/tests/test_backend.py::test_start_analytics_backend_for_mgon_agent No newline at end of file scripts/run_tests_locally-analytics-frontend.sh +4 −2 Original line number Diff line number Diff line Loading @@ -19,9 +19,11 @@ PROJECTDIR=`pwd` cd $PROJECTDIR/src RCFILE=$PROJECTDIR/coverage/.coveragerc export KFK_SERVER_ADDRESS='127.0.0.1:9092' export KFK_SERVER_ADDRESS='127.0.0.1:9094' CRDB_SQL_ADDRESS=$(kubectl get service cockroachdb-public --namespace crdb -o jsonpath='{.spec.clusterIP}') export CRDB_URI="cockroachdb://tfs:tfs123@${CRDB_SQL_ADDRESS}:26257/tfs_analytics?sslmode=require" python3 -m pytest --log-level=DEBUG --log-cli-level=INFO --verbose \ analytics/frontend/tests/test_frontend.py analytics/frontend/tests/test_frontend.py::test_StartAnalyzer_MGON_Agent # python3 -m pytest --log-level=DEBUG --log-cli-level=INFO --verbose \ # analytics/frontend/tests/test_frontend.py scripts/run_tests_locally-telemetry-gnmi.sh +3 −3 Original line number Diff line number Diff line Loading @@ -21,10 +21,10 @@ export KFK_SERVER_ADDRESS='127.0.0.1:9094' # This is unit test (should be tested with container-lab running) python3 -m pytest --log-level=info --log-cli-level=info --verbose \ telemetry/backend/tests/gnmi_oc/test_unit_GnmiOpenConfigCollector.py telemetry/backend/tests/gnmi_oc/test_unit_GnmiOpenConfigCollector.py::test_full_workflow # This is integration test (should be tested with container-lab running) python3 -m pytest --log-level=info --log-cli-level=info --verbose \ telemetry/backend/tests/gnmi_oc/test_integration_GnmiOCcollector.py # python3 -m pytest --log-level=info --log-cli-level=info --verbose \ # telemetry/backend/tests/gnmi_oc/test_integration_GnmiOCcollector.py echo "Bye!" src/analytics/backend/service/Streamer.py +6 −6 Original line number Diff line number Diff line Loading @@ -33,7 +33,7 @@ class DaskStreamer(threading.Thread): window_size = None, cluster_instance = None, producer_instance = AnalyzerHelper.initialize_kafka_producer() ): ) -> None: super().__init__() self.key = key self.input_kpis = input_kpis Loading src/analytics/backend/tests/messages_analyzer.py +19 −0 Original line number Diff line number Diff line Loading @@ -15,6 +15,25 @@ import pandas as pd from analytics.backend.service.AnalyzerHandlers import Handlers def create_analysis_request_message_for_mgon_agent(): return { "request_id": "test_request_mgon_001", "oper_mode": "test_mode", "input_kpi_list": ["6e22f180-ba28-4641-b190-2287bf448888"], "output_kpi_list": ["6e22f180-ba28-4641-b190-2287bf181818"], "task_type": Handlers.AGGREGATION_HANDLER.value, "task_parameter": { "avg": [-5, -20], }, "duration": 90, "batch_duration": 20, "window_size": None, "batch_size": 5, "interval": 5, } def get_input_kpi_list(): return ["1e22f180-ba28-4641-b190-2287bf446666", "6e22f180-ba28-4641-b190-2287bf448888", 'kpi_3'] Loading Loading
scripts/run_tests_locally-analytics-backend.sh +6 −3 Original line number Diff line number Diff line Loading @@ -19,10 +19,13 @@ PROJECTDIR=`pwd` cd $PROJECTDIR/src RCFILE=$PROJECTDIR/coverage/.coveragerc export KFK_SERVER_ADDRESS='127.0.0.1:9092' export KFK_SERVER_ADDRESS='127.0.0.1:9094' CRDB_SQL_ADDRESS=$(kubectl get service cockroachdb-public --namespace crdb -o jsonpath='{.spec.clusterIP}') export CRDB_URI="cockroachdb://tfs:tfs123@${CRDB_SQL_ADDRESS}:26257/tfs_analytics?sslmode=require" python3 -m pytest --log-level=DEBUG --log-cli-level=INFO --verbose \ analytics/backend/tests/test_backend.py # python3 -m pytest --log-level=DEBUG --log-cli-level=INFO --verbose \ # analytics/backend/tests/test_backend.py python3 -m pytest --log-level=DEBUG --log-cli-level=DEBUG --verbose \ analytics/backend/tests/test_backend.py::test_start_analytics_backend_for_mgon_agent No newline at end of file
scripts/run_tests_locally-analytics-frontend.sh +4 −2 Original line number Diff line number Diff line Loading @@ -19,9 +19,11 @@ PROJECTDIR=`pwd` cd $PROJECTDIR/src RCFILE=$PROJECTDIR/coverage/.coveragerc export KFK_SERVER_ADDRESS='127.0.0.1:9092' export KFK_SERVER_ADDRESS='127.0.0.1:9094' CRDB_SQL_ADDRESS=$(kubectl get service cockroachdb-public --namespace crdb -o jsonpath='{.spec.clusterIP}') export CRDB_URI="cockroachdb://tfs:tfs123@${CRDB_SQL_ADDRESS}:26257/tfs_analytics?sslmode=require" python3 -m pytest --log-level=DEBUG --log-cli-level=INFO --verbose \ analytics/frontend/tests/test_frontend.py analytics/frontend/tests/test_frontend.py::test_StartAnalyzer_MGON_Agent # python3 -m pytest --log-level=DEBUG --log-cli-level=INFO --verbose \ # analytics/frontend/tests/test_frontend.py
scripts/run_tests_locally-telemetry-gnmi.sh +3 −3 Original line number Diff line number Diff line Loading @@ -21,10 +21,10 @@ export KFK_SERVER_ADDRESS='127.0.0.1:9094' # This is unit test (should be tested with container-lab running) python3 -m pytest --log-level=info --log-cli-level=info --verbose \ telemetry/backend/tests/gnmi_oc/test_unit_GnmiOpenConfigCollector.py telemetry/backend/tests/gnmi_oc/test_unit_GnmiOpenConfigCollector.py::test_full_workflow # This is integration test (should be tested with container-lab running) python3 -m pytest --log-level=info --log-cli-level=info --verbose \ telemetry/backend/tests/gnmi_oc/test_integration_GnmiOCcollector.py # python3 -m pytest --log-level=info --log-cli-level=info --verbose \ # telemetry/backend/tests/gnmi_oc/test_integration_GnmiOCcollector.py echo "Bye!"
src/analytics/backend/service/Streamer.py +6 −6 Original line number Diff line number Diff line Loading @@ -33,7 +33,7 @@ class DaskStreamer(threading.Thread): window_size = None, cluster_instance = None, producer_instance = AnalyzerHelper.initialize_kafka_producer() ): ) -> None: super().__init__() self.key = key self.input_kpis = input_kpis Loading
src/analytics/backend/tests/messages_analyzer.py +19 −0 Original line number Diff line number Diff line Loading @@ -15,6 +15,25 @@ import pandas as pd from analytics.backend.service.AnalyzerHandlers import Handlers def create_analysis_request_message_for_mgon_agent(): return { "request_id": "test_request_mgon_001", "oper_mode": "test_mode", "input_kpi_list": ["6e22f180-ba28-4641-b190-2287bf448888"], "output_kpi_list": ["6e22f180-ba28-4641-b190-2287bf181818"], "task_type": Handlers.AGGREGATION_HANDLER.value, "task_parameter": { "avg": [-5, -20], }, "duration": 90, "batch_duration": 20, "window_size": None, "batch_size": 5, "interval": 5, } def get_input_kpi_list(): return ["1e22f180-ba28-4641-b190-2287bf446666", "6e22f180-ba28-4641-b190-2287bf448888", 'kpi_3'] Loading