Commit 191657c9 authored by Sergio Gonzalez Diaz's avatar Sergio Gonzalez Diaz
Browse files

Test coverage

parent 59398a94
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -2,7 +2,7 @@
build monitoring:
  variables:
    IMAGE_NAME: 'monitoring' # name of the microservice
    IMAGE_TAG: 'latest' # tag of the container image (production, development, etc)
    IMAGE_TAG: 'coverage' # tag of the container image (production, development, etc)
  stage: build
  before_script:
    - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
@@ -26,7 +26,7 @@ build monitoring:
unit test monitoring:
  variables:
    IMAGE_NAME: 'monitoring' # name of the microservice
    IMAGE_TAG: 'latest' # tag of the container image (production, development, etc)
    IMAGE_TAG: 'coverage' # tag of the container image (production, development, etc)
  stage: unit_test
  needs:
    - build monitoring
@@ -43,7 +43,8 @@ unit test monitoring:
    - sleep 30
    - docker ps -a
    - docker logs $IMAGE_NAME
    - docker exec -i $IMAGE_NAME bash -c "pytest --junitxml=/opt/results/report.xml"
    - docker exec -i $IMAGE_NAME bash -c "coverage run -m pytest --junitxml=/opt/results/report.xml"
    - docker exec -i $IMAGE_NAME bash -c "coverage report -m"
  after_script:
    - docker rm -f $IMAGE_NAME
    - docker rm -f  influxdb
@@ -67,7 +68,7 @@ unit test monitoring:
deploy monitoring:
  variables:
    IMAGE_NAME: 'monitoring' # name of the microservice
    IMAGE_TAG: 'latest' # tag of the container image (production, development, etc)
    IMAGE_TAG: 'coverage' # tag of the container image (production, development, etc)
  stage: deploy
  needs:
    - unit test monitoring
+2 −1
Original line number Diff line number Diff line
@@ -10,3 +10,4 @@ pytest
pytest-benchmark
influxdb
redis
coverage
 No newline at end of file