Skip to content
Snippets Groups Projects
Commit 3c3b2dfa authored by Lluis Gifre Renom's avatar Lluis Gifre Renom
Browse files

Minor improvements in integration tests

parent db998f06
No related branches found
No related tags found
1 merge request!54Release 2.0.0
#!/bin/bash
## Make folder containing the script the root folder for its execution
#cd $(dirname $0)
#ENDPOINT=($(kubectl --namespace teraflow-development get service contextservice -o 'jsonpath={.spec.clusterIP} {.spec.ports[?(@.name=="grpc")].port}'))
#docker run -it --env TEST_TARGET_ADDRESS=${ENDPOINT[0]} --env TEST_TARGET_PORT=${ENDPOINT[1]} context_service:test
kubectl run integration-test --restart=Never --rm -i --tty --image centos -- /bin/bash
IMAGE_NAME='integration_tester'
IMAGE_TAG='latest'
CI_REGISTRY_IMAGE='registry.gitlab.com/teraflow-h2020/controller'
kubectl delete pod $(echo $IMAGE_NAME | sed -r 's/[^a-zA-Z0-9\.\-]/-/g') --wait=true --ignore-not-found=true
kubectl get all
kubectl run $(echo $IMAGE_NAME | sed -r 's/[^a-zA-Z0-9\.\-]/-/g') --image "$CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG" --restart=Never --rm -i
kubectl get all
......@@ -2,6 +2,7 @@ from typing import Dict, List, Set, Tuple
import grpc, logging
from prometheus_client import Counter, Histogram
from common.Checkers import chk_string
from common.database.api.Constants import DEFAULT_CONTEXT_ID, DEFAULT_TOPOLOGY_ID
from common.database.api.Database import Database
from common.exceptions.ServiceException import ServiceException
from context.proto.context_pb2 import Empty, Link, LinkId, Topology
......@@ -9,9 +10,6 @@ from context.proto.context_pb2_grpc import ContextServiceServicer
LOGGER = logging.getLogger(__name__)
DEFAULT_CONTEXT_ID = 'admin'
DEFAULT_TOPOLOGY_ID = 'admin'
GETTOPOLOGY_COUNTER_STARTED = Counter ('context_gettopology_counter_started',
'Context:GetTopology counter of requests started' )
GETTOPOLOGY_COUNTER_COMPLETED = Counter ('context_gettopology_counter_completed',
......
......@@ -2,6 +2,7 @@ from typing import List, Tuple
import grpc, logging
from prometheus_client import Counter, Histogram
from common.Checkers import chk_options, chk_string
from common.database.api.Constants import DEFAULT_CONTEXT_ID, DEFAULT_TOPOLOGY_ID
from common.database.api.Database import Database
from common.database.api.context.OperationalStatus import OperationalStatus, operationalstatus_enum_values, \
to_operationalstatus_enum
......@@ -11,9 +12,6 @@ from device.proto.device_pb2_grpc import DeviceServiceServicer
LOGGER = logging.getLogger(__name__)
DEFAULT_CONTEXT_ID = 'admin'
DEFAULT_TOPOLOGY_ID = 'admin'
ADDDEVICE_COUNTER_STARTED = Counter ('device_adddevice_counter_started',
'Device:AddDevice counter of requests started' )
ADDDEVICE_COUNTER_COMPLETED = Counter ('device_adddevice_counter_completed',
......
......@@ -57,8 +57,7 @@ integration_test integration_tester:
- kubectl get all
- kubectl delete pod $(echo $IMAGE_NAME | sed -r 's/[^a-zA-Z0-9\.\-]/-/g') --wait=true --ignore-not-found=true
- kubectl get all
# --rm to remove tester when it finishes
- kubectl run $(echo $IMAGE_NAME | sed -r 's/[^a-zA-Z0-9\.\-]/-/g') --image "$CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG" --restart=Never -i
- kubectl run $(echo $IMAGE_NAME | sed -r 's/[^a-zA-Z0-9\.\-]/-/g') --image "$CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG" --restart=Never -i --rm
- kubectl get all
#when: manual
#allow_failure: false
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment