diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 8dc2303883c44a3a4ad40e059a734378c6887e6f..a458a07f8fc81b2bed9b8c80c5eb9e09e39b0b99 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -15,6 +15,7 @@ stages: - linting - static-analysis - unit-tests + - integration-tests linting: stage: linting script: @@ -34,3 +35,12 @@ unit_test: script: - cd devices - tox -e py37 +integration_test: + stage: integration-tests + image: docker:19.03.12 + services: + - docker:19.03.12-dind + before_script: + - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY + script: + - ./sbin/run_integration_test.sh diff --git a/sbin/run_integration_test.sh b/sbin/run_integration_test.sh new file mode 100755 index 0000000000000000000000000000000000000000..d54163625541c13816bf0309c09a2713ce35add9 --- /dev/null +++ b/sbin/run_integration_test.sh @@ -0,0 +1,22 @@ +#!/bin/bash + +# Check if lofar20rc.sh is sourced and environment variables are set. +if [ -z "$LOFAR20_DIR" ]; then + echo "\$LOFAR20_DIR is unset or blank, is lofar20rc.sh sourced correctly?" + exit 1 +fi + +# Start all required containers +cd "$LOFAR20_DIR/docker-compose" || exit 1 +make start databaseds dsconfig device-sdp device-pcc jupyter elk sdptr-sim pypcc-sim + +# Update the dsconfig +cd "$TANGO_LOFAR_LOCAL_DIR" || exit 1 +sbin/update_ConfigDb.sh CDB/integration_ConfigDb.json + +# Start the integration test +cd "$LOFAR20_DIR/docker-compose" || exit 1 +make start integration-test + +# Run the integration test with the output displayed on stdout +docker start -a integration-test \ No newline at end of file