Skip to content
Snippets Groups Projects
Commit 5c841b53 authored by Corné Lukken's avatar Corné Lukken
Browse files

Merge branch 'L2SS-914' into 'master'

Resolve L2SS-914

Closes L2SS-914

See merge request !401
parents b39b5d99 1f7429d7
Branches
Tags
1 merge request!401Resolve L2SS-914
...@@ -529,6 +529,7 @@ unit_test: ...@@ -529,6 +529,7 @@ unit_test:
- tangostationcontrol/.coverage - tangostationcontrol/.coverage
integration_test_docker: integration_test_docker:
stage: integration-tests stage: integration-tests
allow_failure: true
image: docker:latest image: docker:latest
tags: tags:
- privileged - privileged
...@@ -551,6 +552,7 @@ integration_test_docker: ...@@ -551,6 +552,7 @@ integration_test_docker:
tag="$CI_COMMIT_REF_SLUG" tag="$CI_COMMIT_REF_SLUG"
echo "Running on branch '$CI_COMMIT_BRANCH': tag = $tag" echo "Running on branch '$CI_COMMIT_BRANCH': tag = $tag"
fi fi
- apk update
- apk add --update make bash docker-compose - apk add --update make bash docker-compose
- apk add --update bind-tools - apk add --update bind-tools
- apk add --update postgresql14-client gzip - apk add --update postgresql14-client gzip
......
...@@ -150,7 +150,8 @@ DOCKER_COMPOSE_ARGS := DISPLAY=$(DISPLAY) \ ...@@ -150,7 +150,8 @@ DOCKER_COMPOSE_ARGS := DISPLAY=$(DISPLAY) \
CONTAINER_NAME_PREFIX=$(CONTAINER_NAME_PREFIX) \ CONTAINER_NAME_PREFIX=$(CONTAINER_NAME_PREFIX) \
COMPOSE_IGNORE_ORPHANS=true \ COMPOSE_IGNORE_ORPHANS=true \
CONTAINER_EXECUTION_UID=$(shell id -u) \ CONTAINER_EXECUTION_UID=$(shell id -u) \
DOCKER_GID=$(DOCKER_GID) DOCKER_GID=$(DOCKER_GID) \
TEST_MODULE=$(INTEGRATION_MODULE)
.PHONY: up down minimal context run integration start stop restart build build-nocache status clean pull help .PHONY: up down minimal context run integration start stop restart build build-nocache status clean pull help
...@@ -174,7 +175,7 @@ run: minimal ## run a service using arguments and delete it afterwards ...@@ -174,7 +175,7 @@ run: minimal ## run a service using arguments and delete it afterwards
$(DOCKER_COMPOSE_ARGS) docker-compose $(COMPOSE_FILE_ARGS) run --no-deps --rm $(SERVICE) $(SERVICE_ARGS) $(DOCKER_COMPOSE_ARGS) docker-compose $(COMPOSE_FILE_ARGS) run --no-deps --rm $(SERVICE) $(SERVICE_ARGS)
integration: minimal ## run a service using arguments and delete it afterwards integration: minimal ## run a service using arguments and delete it afterwards
TEST_MODULE=$(INTEGRATION_MODULE) $(DOCKER_COMPOSE_ARGS) docker-compose $(COMPOSE_FILE_ARGS) run --no-deps --rm integration-test $(INTEGRATION_ARGS) $(DOCKER_COMPOSE_ARGS) docker-compose $(COMPOSE_FILE_ARGS) run --no-deps --rm integration-test $(INTEGRATION_ARGS)
down: ## stop all services and tear down the system down: ## stop all services and tear down the system
$(DOCKER_COMPOSE_ARGS) docker-compose $(COMPOSE_FILE_ARGS) down $(DOCKER_COMPOSE_ARGS) docker-compose $(COMPOSE_FILE_ARGS) down
......
...@@ -24,12 +24,16 @@ function integration_test { ...@@ -24,12 +24,16 @@ function integration_test {
IFS=" " read -r -a restarts <<< "${2}" IFS=" " read -r -a restarts <<< "${2}"
IFS=" " read -r -a configs <<< "${3}" IFS=" " read -r -a configs <<< "${3}"
for config in "${configs[@]}"; do for config in "${configs[@]}"; do
echo "Updating config ${config} ..."
bash "${LOFAR20_DIR}"/sbin/update_ConfigDb.sh "${config}" bash "${LOFAR20_DIR}"/sbin/update_ConfigDb.sh "${config}"
done done
if [ ! -z "${2+x}" ]; then if [ ! -z "${2+x}" ]; then
# shellcheck disable=SC2145
echo "make restart ${restarts[@]} ..."
make restart "${restarts[@]}" make restart "${restarts[@]}"
fi fi
sleep 5 sleep 5
echo "make integration ${1} ..."
make integration "${1}" make integration "${1}"
} }
......
...@@ -29,12 +29,14 @@ commands = {envpython} -m stestr run {posargs} ...@@ -29,12 +29,14 @@ commands = {envpython} -m stestr run {posargs}
[testenv:integration] [testenv:integration]
; Warning running integration tests will make changes to your docker system! ; Warning running integration tests will make changes to your docker system!
; These tests should only be run by the integration-test docker container. ; These tests should only be run by the integration-test docker container.
allowlist_externals = echo
passenv = TANGO_HOST passenv = TANGO_HOST
setenv = setenv =
VIRTUAL_ENV={envdir} VIRTUAL_ENV={envdir}
TESTS_DIR=./tangostationcontrol/integration_test/{env:TEST_MODULE:default} TESTS_DIR=./tangostationcontrol/integration_test/{env:TEST_MODULE:default}
PYTHON={envpython} -m coverage run --source tangostationcontrol --parallel-mode PYTHON={envpython} -m coverage run --source tangostationcontrol --parallel-mode
commands = commands =
echo "Integration test directory configured for{env:TESTS_DIR} ({env:TEST_MODULE})"
{envpython} -m stestr run --serial {posargs} {envpython} -m stestr run --serial {posargs}
{envpython} -m coverage combine {envpython} -m coverage combine
{envpython} -m coverage html --omit='*test*' -d cover {envpython} -m coverage html --omit='*test*' -d cover
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment