diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 8037f7db6aa3c201247f4268a35df4c16985d521..5c222a48dcd223050f203a69d7b4f4b4d99ccdb7 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -529,6 +529,7 @@ unit_test: - tangostationcontrol/.coverage integration_test_docker: stage: integration-tests + allow_failure: true image: docker:latest tags: - privileged @@ -551,6 +552,7 @@ integration_test_docker: tag="$CI_COMMIT_REF_SLUG" echo "Running on branch '$CI_COMMIT_BRANCH': tag = $tag" fi + - apk update - apk add --update make bash docker-compose - apk add --update bind-tools - apk add --update postgresql14-client gzip diff --git a/docker-compose/Makefile b/docker-compose/Makefile index b3b736fc57a644ce05f4a8c11973be7042a7079f..7606e94abd344a9c255463664bf2f55d8e556b93 100644 --- a/docker-compose/Makefile +++ b/docker-compose/Makefile @@ -150,7 +150,8 @@ DOCKER_COMPOSE_ARGS := DISPLAY=$(DISPLAY) \ CONTAINER_NAME_PREFIX=$(CONTAINER_NAME_PREFIX) \ COMPOSE_IGNORE_ORPHANS=true \ 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 @@ -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) 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 $(DOCKER_COMPOSE_ARGS) docker-compose $(COMPOSE_FILE_ARGS) down diff --git a/sbin/run_integration_test.sh b/sbin/run_integration_test.sh index 30df5c7cf02be8a26b86c506299d64e0acfa45ef..65beb8bc65ef32c79d29794281e5f3da2023456a 100755 --- a/sbin/run_integration_test.sh +++ b/sbin/run_integration_test.sh @@ -24,12 +24,16 @@ function integration_test { IFS=" " read -r -a restarts <<< "${2}" IFS=" " read -r -a configs <<< "${3}" for config in "${configs[@]}"; do + echo "Updating config ${config} ..." bash "${LOFAR20_DIR}"/sbin/update_ConfigDb.sh "${config}" done if [ ! -z "${2+x}" ]; then + # shellcheck disable=SC2145 + echo "make restart ${restarts[@]} ..." make restart "${restarts[@]}" fi sleep 5 + echo "make integration ${1} ..." make integration "${1}" } diff --git a/tangostationcontrol/tox.ini b/tangostationcontrol/tox.ini index c87e4605816e3ea7ee22dfd9731d73c7912f85d8..9bd8b804bcfabb04d4caf630c926fdcbe30ef1f9 100644 --- a/tangostationcontrol/tox.ini +++ b/tangostationcontrol/tox.ini @@ -29,12 +29,14 @@ commands = {envpython} -m stestr run {posargs} [testenv:integration] ; Warning running integration tests will make changes to your docker system! ; These tests should only be run by the integration-test docker container. +allowlist_externals = echo passenv = TANGO_HOST setenv = VIRTUAL_ENV={envdir} TESTS_DIR=./tangostationcontrol/integration_test/{env:TEST_MODULE:default} PYTHON={envpython} -m coverage run --source tangostationcontrol --parallel-mode commands = + echo "Integration test directory configured for{env:TESTS_DIR} ({env:TEST_MODULE})" {envpython} -m stestr run --serial {posargs} {envpython} -m coverage combine {envpython} -m coverage html --omit='*test*' -d cover