diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 1415782872cbc7726a9f7a3c182cabe4803ab6f9..194e93a6daaf94f43fd4ec0843bee0ca3f41c4d6 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -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' diff --git a/src/tests/.gitlab-ci.yml b/src/tests/.gitlab-ci.yml index db44b9e4a8d29475a0b6cd620ffd9a6961f8cdc5..d48456b8371e1bd6445d4895f4e72d8eef278a4e 100644 --- a/src/tests/.gitlab-ci.yml +++ b/src/tests/.gitlab-ci.yml @@ -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' diff --git a/src/tests/ofc22/.gitlab-ci.yml b/src/tests/ofc22/.gitlab-ci.yml new file mode 100644 index 0000000000000000000000000000000000000000..5f8f8dd1bbefc227e6d4b938b175235bff5e6ced --- /dev/null +++ b/src/tests/ofc22/.gitlab-ci.yml @@ -0,0 +1,44 @@ +# 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