Skip to content
Snippets Groups Projects
Commit 6e6e496c authored by Andrew Kapuscinski's avatar Andrew Kapuscinski
Browse files

refactored unit-test template to run tests inside of service images

parent 2890cabf
No related branches found
No related tags found
No related merge requests found
Pipeline #810 failed
......@@ -114,9 +114,6 @@ unit test dev workflow:
variables:
SERVICE_NAME: "workflow"
extends: .unit-test
artifacts:
paths:
- .coverage.${SERVICE_NAME}.${CI_COMMIT_SHORT_SHA}
needs:
- build dev workflow
......@@ -125,9 +122,6 @@ unit test dev capability:
variables:
SERVICE_NAME: "capability"
extends: .unit-test
artifacts:
paths:
- .coverage.${SERVICE_NAME}.${CI_COMMIT_SHORT_SHA}
needs:
- build dev capability
......@@ -136,9 +130,6 @@ unit test dev notification:
variables:
SERVICE_NAME: "notification"
extends: .unit-test
artifacts:
paths:
- .coverage.${SERVICE_NAME}.${CI_COMMIT_SHORT_SHA}
needs:
- build dev notification
......@@ -166,9 +157,7 @@ unit test coverage:
- unit test dev notification
rules:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
when: always
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
when: always
# Push Stages
push dev workflow:
......@@ -248,7 +237,6 @@ pages:
expire_in: 2 weeks
rules:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
when: always
# Development
deploy dev:
......
.unit-test:
image: ${REGISTRY_URL}/${PROJECT_NAME}/${SERVICE_NAME}:${CI_COMMIT_SHORT_SHA}
script:
- IMAGE_NAME="${REGISTRY_URL}/${PROJECT_NAME}/${SERVICE_NAME}"
- TEST_CONTAINER="${SERVICE_NAME}-${CI_COMMIT_SHORT_SHA}"
- docker run --name "${TEST_CONTAINER}" ${IMAGE_NAME}:${CI_COMMIT_SHORT_SHA} ./bin/run-tests.sh -b
- docker cp "${TEST_CONTAINER}":/code/.coverage ./.coverage.${SERVICE_NAME}.${CI_COMMIT_SHORT_SHA}
- docker container stop "${TEST_CONTAINER}" && docker container rm "${TEST_CONTAINER}"
- /code/bin/run-tests.sh -b
artifacts:
paths:
- .coverage.${SERVICE_NAME}.${CI_COMMIT_SHORT_SHA}
rules:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
when: always
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
when: always
\ No newline at end of file
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment