Commit 5f62f791 authored by Lluis Gifre Renom's avatar Lluis Gifre Renom
Browse files

Code cleanup

parent 80939202
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -14,7 +14,6 @@
# limitations under the License.

set -euo pipefail
: "${KUBECONFIG:=/var/snap/microk8s/current/credentials/client.config}"


# -----------------------------------------------------------
@@ -30,7 +29,7 @@ RELEASE_NAME_PROM="mon-prometheus"
CHART_REPO_NAME_PROM="prometheus-community"
CHART_REPO_URL_PROM="https://prometheus-community.github.io/helm-charts"
CHART_NAME_PROM="prometheus"
VALUES_FILE_PROM="$VALUES_FILE_PATH/prometheus_values.yaml"       # Values file for Prometheus and gateway
VALUES_FILE_PROM="$VALUES_FILE_PATH/prometheus_values.yaml"

# -----------------------------------------------------------
# Mimir Configuration
@@ -78,8 +77,7 @@ deploy_chart() {
    echo "Installing/Upgrading $release_name using custom values from $values_file..."
    helm upgrade --install "$release_name" "$chart_repo_name/$chart_name" \
      --namespace "$namespace" \
      --values "$values_file" \
      --kubeconfig "$KUBECONFIG"
      --values "$values_file"
  else
    echo "Installing/Upgrading $release_name with default chart values..."
    helm upgrade --install "$release_name" "$chart_repo_name/$chart_name" \
+0 −2
Original line number Diff line number Diff line
@@ -40,8 +40,6 @@ spec:
    protocol: TCP
    targetPort: 9094
---


apiVersion: apps/v1
kind: StatefulSet
metadata:
+1 −2
Original line number Diff line number Diff line
@@ -19,7 +19,6 @@ PROJECTDIR=`pwd`
cd $PROJECTDIR/src

RCFILE=$PROJECTDIR/coverage/.coveragerc
# CRDB_SQL_ADDRESS=$(kubectl --namespace ${CRDB_NAMESPACE} get service cockroachdb-public -o 'jsonpath={.spec.clusterIP}')
# export CRDB_URI="cockroachdb://tfs:tfs123@${CRDB_SQL_ADDRESS}:26257/tfs_kpi_mgmt?sslmode=require"

python3 -m pytest --log-level=DEBUG --log-cli-level=DEBUG --verbose \
    kpi_value_writer/tests/test_metric_writer_to_prom.py
+7 −25
Original line number Diff line number Diff line
@@ -13,36 +13,18 @@
# See the License for the specific language governing permissions and
# limitations under the License.

# # Cleanup
# docker rm --force qkd-node
# docker network rm --force qkd-node-br

# # Create Docker network
# docker network create --driver bridge --subnet=172.254.250.0/24 --gateway=172.254.250.254 qkd-node-br

# <<<<<<<< HEAD:scripts/run_tests_locally-telemetry-gnmi.sh
PROJECTDIR=`pwd`
cd $PROJECTDIR/src
# RCFILE=$PROJECTDIR/coverage/.coveragerc

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_telemetry?sslmode=require"
RCFILE=$PROJECTDIR/coverage/.coveragerc

# 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 
export KFK_SERVER_ADDRESS='127.0.0.1:9094'

# this is integration test (should be tested with container-lab running)
# 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_integration_GnmiOCcollector.py # this is integration test
# ========
# # Create QKD Node
# docker run --detach --name qkd-node --network qkd-node-br --ip 172.254.250.101 mock-qkd-node:test
    telemetry/backend/tests/gnmi_oc/test_unit_GnmiOpenConfigCollector.py 

# # Dump QKD Node Docker containers
# docker ps -a
# 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

# echo "Bye!"
# >>>>>>>> develop:src/tests/tools/mock_qkd_node/run.sh
echo "Bye!"
+4 −13
Original line number Diff line number Diff line
@@ -14,7 +14,6 @@

import logging, time
from enum import Enum
#from confluent_kafka.admin import AdminClient, NewTopic
from kafka.admin import KafkaAdminClient, NewTopic
from kafka.errors import TopicAlreadyExistsError
from common.Settings import get_setting
@@ -30,13 +29,6 @@ KAFKA_TOPIC_CREATE_REQUEST_TIMEOUT = 60_000 # ms
KAFKA_TOPIC_CREATE_WAIT_ITERATIONS = 10
KAFKA_TOPIC_CREATE_WAIT_TIME       = 1

KAFKA_TOPIC_NUM_PARTITIONS         = 1
KAFKA_TOPIC_REPLICATION_FACTOR     = 1
#KAFKA_TOPIC_LIST_TIMEOUT           = 5
KAFKA_TOPIC_CREATE_REQUEST_TIMEOUT = 60_000 # ms
KAFKA_TOPIC_CREATE_WAIT_ITERATIONS = 10
KAFKA_TOPIC_CREATE_WAIT_TIME       = 1

class KafkaConfig(Enum):

    @staticmethod
@@ -51,7 +43,6 @@ class KafkaConfig(Enum):
    @staticmethod
    def get_admin_client():
        SERVER_ADDRESS = KafkaConfig.get_kafka_address()
        #ADMIN_CLIENT   = AdminClient({'bootstrap.servers': SERVER_ADDRESS})
        ADMIN_CLIENT   = KafkaAdminClient(bootstrap_servers=SERVER_ADDRESS)
        return ADMIN_CLIENT

Loading