Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
controller
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TFS
controller
Commits
acec60f2
Commit
acec60f2
authored
3 years ago
by
Sergio Gonzalez Diaz
Browse files
Options
Downloads
Patches
Plain Diff
Add code coverage to context
parent
377f12b0
No related branches found
No related tags found
1 merge request
!54
Release 2.0.0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/context/.gitlab-ci.yml
+8
-2
8 additions, 2 deletions
src/context/.gitlab-ci.yml
src/context/requirements.in
+1
-0
1 addition, 0 deletions
src/context/requirements.in
with
9 additions
and
2 deletions
src/context/.gitlab-ci.yml
+
8
−
2
View file @
acec60f2
...
...
@@ -39,11 +39,12 @@ unit test context:
-
docker pull "$CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG"
-
docker pull "redis:6.2"
-
docker run --name redis -d --network=teraflowbridge redis:6.2
-
docker run --name $IMAGE_NAME -d -p 1010:1010 --env "DB_BACKEND=redis" --env "REDIS_SERVICE_HOST=redis" --env "REDIS_SERVICE_PORT=6379" --env "REDIS_DATABASE_ID=0" --network=teraflowbridge $CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG
-
docker run --name $IMAGE_NAME -d -p 1010:1010 --env "DB_BACKEND=redis" --env "REDIS_SERVICE_HOST=redis" --env "REDIS_SERVICE_PORT=6379" --env "REDIS_DATABASE_ID=0"
-v "$PWD/src/$IMAGE_NAME/tests:/opt/results"
--network=teraflowbridge $CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG
-
sleep
10
-
docker ps -a
-
docker logs $IMAGE_NAME
-
docker exec -i $IMAGE_NAME bash -c "pytest --log-level=DEBUG --verbose $IMAGE_NAME/tests/test_unitary.py"
-
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; coverage xml -o /opt/results/${IMAGE_NAME}_coverage.xml; coverage report --include='${IMAGE_NAME}/*' --show-missing"
coverage
:
'
/TOTAL\s+\d+\s+\d+\s+(\d+%)/'
after_script
:
-
docker rm -f $IMAGE_NAME
-
docker rm -f redis
...
...
@@ -58,6 +59,11 @@ unit test context:
-
src/$IMAGE_NAME/tests/Dockerfile
-
manifests/${IMAGE_NAME}service.yaml
-
.gitlab-ci.yml
artifacts
:
when
:
always
reports
:
junit
:
src/$IMAGE_NAME/tests/${IMAGE_NAME}_report.xml
cobertura
:
src/$IMAGE_NAME/tests/${IMAGE_NAME}_coverage.xml
# Deployment of the service in Kubernetes Cluster
deploy context
:
...
...
This diff is collapsed.
Click to expand it.
src/context/requirements.in
+
1
−
0
View file @
acec60f2
...
...
@@ -6,3 +6,4 @@ pytest
pytest-benchmark
redis
requests
coverage
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment