Commit 7a04088a authored by Lluis Gifre Renom's avatar Lluis Gifre Renom
Browse files

CI/CD pipeline - end-to-end automated tests:

- Integrate OFC'22 TFS deployment
parent 657912ce
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -17,10 +17,9 @@ stages:
  #- dependencies
  - build
  - unit_test
  #- deploy
  #- end2end_test
  - end2end_test

# include the individual .gitlab-ci.yml of each micro-service
# include the individual .gitlab-ci.yml of each micro-service and tests
include:
  #- local: '/manifests/.gitlab-ci.yml'
  - local: '/src/monitoring/.gitlab-ci.yml'
@@ -45,3 +44,6 @@ include:
  #- local: '/src/dlt/.gitlab-ci.yml'
  - local: '/src/load_generator/.gitlab-ci.yml'
  - local: '/src/bgpls_speaker/.gitlab-ci.yml'

  # This should be last one: end-to-end integration tests
  - local: '/src/tests/.gitlab-ci.yml'
+6 −2
Original line number Diff line number Diff line
@@ -12,7 +12,11 @@
# See the License for the specific language governing permissions and
# limitations under the License.

# include the individual .gitlab-ci.yml of each integration test
# include the individual .gitlab-ci.yml of each end-to-end integration test
include:
  - local: '/src/tests/ofc22/.gitlab-ci.yml'
  - local: '/src/tests/oeccpsc22/.gitlab-ci.yml'
  #- local: '/src/tests/oeccpsc22/.gitlab-ci.yml'
  #- local: '/src/tests/ecoc22/.gitlab-ci.yml'
  #- local: '/src/tests/nfvsdn22/.gitlab-ci.yml'
  #- local: '/src/tests/ofc23/.gitlab-ci.yml'
  #- local: '/src/tests/ofc24/.gitlab-ci.yml'
+44 −0
Original line number Diff line number Diff line
# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Build, tag, and push the Docker image to the GitLab Docker registry
end2end ofc22:
  variables:
    TEST_NAME: 'ofc22'
  stage: end2end_test
  before_script:
    - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
  script:
    - source src/tests/${TEST_NAME}/deploy_specs.sh
    - export TFS_REGISTRY_IMAGES="labs.etsi.org:5050/tfs/"
    - export TFS_SKIP_BUILD="YES"
    - export TFS_IMAGE_TAG="latest"
    - ./deploy/all.sh
    - while ! kubectl --namespace $TFS_K8S_NAMESPACE logs deployment/contextservice -c server 2>&1 | grep -q 'Subscriber is Ready? True'; do sleep 1; done
    - kubectl --namespace $TFS_K8S_NAMESPACE logs deployment/contextservice -c server
    ## Run the tests
    #- >
    #  docker exec -i $IMAGE_NAME bash -c
    #  "coverage run -m pytest --log-level=INFO --verbose $IMAGE_NAME/tests/test_unitary.py --junitxml=/opt/results/${IMAGE_NAME}_report.xml"
    #- docker exec -i $IMAGE_NAME bash -c "coverage report --include='${IMAGE_NAME}/*' --show-missing"
  after_script:
    - docker images --filter="dangling=true" --quiet | xargs -r docker rmi
  #coverage: '/TOTAL\s+\d+\s+\d+\s+(\d+%)/'
  rules:
    - if: '$CI_PIPELINE_SOURCE == "merge_request_event" && ($CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "develop" || $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH)'
    - if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "develop"'
  artifacts:
      when: always
      reports:
        junit: src/$IMAGE_NAME/tests/${IMAGE_NAME}_report.xml