Skip to content
Snippets Groups Projects
Commit d9c612a1 authored by Stefano Di Frischia's avatar Stefano Di Frischia
Browse files

Merge branch 'master' into L2SS-822-cache-archiver-ts-docker-image

parents b292294a 7fb3ff82
No related branches found
No related tags found
1 merge request!417Resolve L2SS-822 "Cache archiver ts docker image"
Showing
with 142 additions and 67 deletions
...@@ -42,23 +42,34 @@ stages: ...@@ -42,23 +42,34 @@ stages:
- . bootstrap/etc/lofar20rc.sh || true - . bootstrap/etc/lofar20rc.sh || true
## Allow docker image script to execute ## Allow docker image script to execute
# - chmod u+x $CI_PROJECT_DIR/sbin/tag_and_push_docker_image.sh # - chmod u+x $CI_PROJECT_DIR/sbin/tag_and_push_docker_image.sh
# Template for docker images NOT on tagged or master builds
.base_docker_images_except: .base_docker_images_except:
extends: .base_docker_images extends: .base_docker_images
except: except:
refs: refs:
- tags - tags
- master - master
# Template to download all remote images and store them on our image registry
# (call tag_and_push without arguments)
.base_docker_store_images: .base_docker_store_images:
extends: .base_docker_images extends: .base_docker_images
script: script:
# Do not remove 'bash' or statement will be ignored by primitive docker shell # Do not remove 'bash' or statement will be ignored by primitive docker shell
- bash $CI_PROJECT_DIR/sbin/tag_and_push_docker_image.sh - bash $CI_PROJECT_DIR/sbin/tag_and_push_docker_image.sh
# Download all remote images and store them on our image registry for tagged
# master builds
docker_store_images_master_tag: docker_store_images_master_tag:
extends: .base_docker_store_images extends: .base_docker_store_images
only: only:
refs: refs:
- tags - tags
- master - master
# Download all remote images and store them on our image registry if .env changes
# on a merge request
docker_store_images_changes: docker_store_images_changes:
extends: .base_docker_store_images extends: .base_docker_store_images
# This will spawn as detached pipeline but atleast ensures the changes rule # This will spawn as detached pipeline but atleast ensures the changes rule
...@@ -70,6 +81,8 @@ docker_store_images_changes: ...@@ -70,6 +81,8 @@ docker_store_images_changes:
- merge_requests - merge_requests
changes: changes:
- docker-compose/.env - docker-compose/.env
# Build and push all our custom images on tagged or master builds
docker_build_image_all: docker_build_image_all:
extends: .base_docker_images extends: .base_docker_images
only: only:
...@@ -115,30 +128,32 @@ docker_build_image_all: ...@@ -115,30 +128,32 @@ docker_build_image_all:
- bash $CI_PROJECT_DIR/sbin/tag_and_push_docker_image.sh hdbpp latest - bash $CI_PROJECT_DIR/sbin/tag_and_push_docker_image.sh hdbpp latest
- bash $CI_PROJECT_DIR/sbin/tag_and_push_docker_image.sh hdbppts-cm latest - bash $CI_PROJECT_DIR/sbin/tag_and_push_docker_image.sh hdbppts-cm latest
- bash $CI_PROJECT_DIR/sbin/tag_and_push_docker_image.sh hdbppts-es latest - bash $CI_PROJECT_DIR/sbin/tag_and_push_docker_image.sh hdbppts-es latest
docker_build_image_elk:
# Build and push custom images on merge request if relevant files changed
docker_build_image_lofar_device_base:
extends: .base_docker_images_except extends: .base_docker_images_except
only: only:
refs: refs:
- merge_requests - merge_requests
changes: changes:
- docker-compose/elk.yml - docker-compose/lofar-device-base.yml
- docker-compose/elk/* - docker-compose/lofar-device-base/*
- docker-compose/elk-configure-host/*
script: script:
# Do not remove 'bash' or statement will be ignored by primitive docker shell # Do not remove 'bash' or statement will be ignored by primitive docker shell
- bash $CI_PROJECT_DIR/sbin/tag_and_push_docker_image.sh elk $tag - bash $CI_PROJECT_DIR/sbin/tag_and_push_docker_image.sh lofar-device-base $tag
- bash $CI_PROJECT_DIR/sbin/tag_and_push_docker_image.sh elk-configure-host $tag docker_build_image_elk:
docker_build_image_lofar_device_base:
extends: .base_docker_images_except extends: .base_docker_images_except
only: only:
refs: refs:
- merge_requests - merge_requests
changes: changes:
- docker-compose/lofar-device-base.yml - docker-compose/elk.yml
- docker-compose/lofar-device-base/* - docker-compose/elk/*
- docker-compose/elk-configure-host/*
script: script:
# Do not remove 'bash' or statement will be ignored by primitive docker shell # Do not remove 'bash' or statement will be ignored by primitive docker shell
- bash $CI_PROJECT_DIR/sbin/tag_and_push_docker_image.sh lofar-device-base $tag - bash $CI_PROJECT_DIR/sbin/tag_and_push_docker_image.sh elk $tag
- bash $CI_PROJECT_DIR/sbin/tag_and_push_docker_image.sh elk-configure-host $tag
docker_build_image_prometheus: docker_build_image_prometheus:
extends: .base_docker_images_except extends: .base_docker_images_except
only: only:
...@@ -622,10 +637,6 @@ wheel_packaging: ...@@ -622,10 +637,6 @@ wheel_packaging:
artifacts: artifacts:
paths: paths:
- tangostationcontrol/dist/*.whl - tangostationcontrol/dist/*.whl
before_script:
- pip3 install build
- pip3 install -r tangostationcontrol/test-requirements.txt
- pip3 install -r docker-compose/itango/lofar-requirements.txt
script: script:
- cd tangostationcontrol - cd tangostationcontrol
- python -m build - tox -e build
...@@ -93,7 +93,7 @@ ...@@ -93,7 +93,7 @@
"RECV, RECV_TEMP_error_R" "RECV, RECV_TEMP_error_R"
], ],
"Shutdown_Device_List":[ "Shutdown_Device_List":[
"STAT/SDP/1", "STAT/UNB2/1", "STAT/RECV/1", "STAT/APSCT/1", "STAT/APSPU/1" "STAT/SDP/1", "STAT/UNB2/1", "STAT/RECV/1", "STAT/APSCT/1", "STAT/CCD/1", "STAT/APSPU/1"
] ]
} }
} }
......
...@@ -140,12 +140,6 @@ ...@@ -140,12 +140,6 @@
"TemperatureManager": { "TemperatureManager": {
"STAT/TemperatureManager/1": { "STAT/TemperatureManager/1": {
"properties": { "properties": {
"Alarm_Error_List": [
"RECV, HBAT_LED_on_RW"
],
"Shutdown_Device_List":[
"STAT/SDP/1", "STAT/UNB2/1", "STAT/RECV/1", "STAT/APSCT/1", "STAT/CCD/1","STAT/APSPU/1"
]
} }
} }
} }
......
...@@ -35,10 +35,10 @@ else ...@@ -35,10 +35,10 @@ else
# Install the package, exit 1 if it fails # Install the package, exit 1 if it fails
# pip install ./ will _NOT_ install dependencies in requirements.txt! # pip install ./ will _NOT_ install dependencies in requirements.txt!
rm -rf /tmp/tangostationcontrol rm -rf /tmp/tangostationcontrol
cp -R /opt/lofar/tango/tangostationcontrol /tmp/ # Ideally we would use git copy but it can't copy on subdirectory level
# DO NOT PUT SPACES IN THE EXCLUDE LIST!
rsync -av --progress --exclude={".tox","*.egg-info","dist","build",".git","*.pyc"} /opt/lofar/tango/tangostationcontrol /tmp/
cd /tmp/tangostationcontrol || exit 1 cd /tmp/tangostationcontrol || exit 1
# Remove the build directory if copied from the source
rm -rf build
pip -vvv install --upgrade --force-reinstall ./ pip -vvv install --upgrade --force-reinstall ./
fi fi
......
...@@ -16,7 +16,7 @@ services: ...@@ -16,7 +16,7 @@ services:
context: . context: .
dockerfile: lofar-device-base/Dockerfile dockerfile: lofar-device-base/Dockerfile
args: args:
SOURCE_IMAGE: ${DOCKER_REGISTRY_HOST}/${DOCKER_REGISTRY_USER}-tango-itango:${TANGO_ITANGO_VERSION} SOURCE_IMAGE: ${LOCAL_DOCKER_REGISTRY_HOST}/${LOCAL_DOCKER_REGISTRY_USER}/tango-itango:${TANGO_ITANGO_VERSION}
container_name: ${CONTAINER_NAME_PREFIX}device-pcon container_name: ${CONTAINER_NAME_PREFIX}device-pcon
logging: logging:
driver: "json-file" driver: "json-file"
......
...@@ -16,7 +16,7 @@ services: ...@@ -16,7 +16,7 @@ services:
context: . context: .
dockerfile: lofar-device-base/Dockerfile dockerfile: lofar-device-base/Dockerfile
args: args:
SOURCE_IMAGE: ${DOCKER_REGISTRY_HOST}/${DOCKER_REGISTRY_USER}-tango-itango:${TANGO_ITANGO_VERSION} SOURCE_IMAGE: ${LOCAL_DOCKER_REGISTRY_HOST}/${LOCAL_DOCKER_REGISTRY_USER}/tango-itango:${TANGO_ITANGO_VERSION}
container_name: ${CONTAINER_NAME_PREFIX}device-psoc container_name: ${CONTAINER_NAME_PREFIX}device-psoc
logging: logging:
driver: "json-file" driver: "json-file"
......
...@@ -30,7 +30,12 @@ services: ...@@ -30,7 +30,12 @@ services:
- --timeout=30 - --timeout=30
- --strict - --strict
- -- - --
- tox --recreate -e integration - tox -e integration
# TODO(L2SS-992): Update me to use sitepackages once L2SS-992 is fixed.
# sitepackages can be enabled for inside docker once pytango is installed from
# requirements.txt (To ensure reliable builds / all environments same versions)
# When run outside of docker, environment will be recreated if mismatched
# - tox --sitepackages -e integration
command: command:
# Allow for arguments to be passed that wil be put after the entrypoint # Allow for arguments to be passed that wil be put after the entrypoint
# tox is configured to take these arguments as integration test directory # tox is configured to take these arguments as integration test directory
......
ARG SOURCE_IMAGE ARG SOURCE_IMAGE
FROM ${SOURCE_IMAGE} FROM ${SOURCE_IMAGE}
RUN sudo apt-get update && sudo apt-get install -y git g++ gcc shellcheck graphviz python3-dev && sudo apt-get clean RUN sudo apt-get update
RUN sudo apt-get install -y git && sudo apt-get clean
RUN sudo apt-get install -y g++ gcc && sudo apt-get clean
RUN sudo apt-get install -y shellcheck graphviz && sudo apt-get clean
RUN sudo apt-get install -y python3-dev libboost-python-dev pkg-config && sudo apt-get clean
RUN sudo apt-get install -y rsync && sudo apt-get clean
COPY lofar-device-base/lofar-requirements.txt /lofar-requirements.txt COPY lofar-device-base/lofar-requirements.txt /lofar-requirements.txt
RUN sudo pip3 install -r /lofar-requirements.txt RUN sudo pip3 install -r /lofar-requirements.txt
......
...@@ -32,7 +32,8 @@ function integration_test { ...@@ -32,7 +32,8 @@ function integration_test {
echo "make restart ${restarts[@]} ..." echo "make restart ${restarts[@]} ..."
make restart "${restarts[@]}" make restart "${restarts[@]}"
fi fi
sleep 5 #TODO(L2SS-988): Use healthcheck to wait for containers to become ready
sleep 30
echo "make integration ${1} ..." echo "make integration ${1} ..."
make integration "${1}" make integration "${1}"
} }
...@@ -64,6 +65,8 @@ fi ...@@ -64,6 +65,8 @@ fi
cd "$LOFAR20_DIR/docker-compose" || exit 1 cd "$LOFAR20_DIR/docker-compose" || exit 1
# Start the database server first # Start the database server first
make build databaseds dsconfig make build databaseds dsconfig
make start databaseds dsconfig make start databaseds dsconfig
...@@ -90,8 +93,22 @@ make build archiver-timescale hdbppts-cm hdbppts-es ...@@ -90,8 +93,22 @@ make build archiver-timescale hdbppts-cm hdbppts-es
# shellcheck disable=SC2086 # shellcheck disable=SC2086
make stop $DEVICES $SIMULATORS hdbppts-es hdbppts-cm archiver-timescale make stop $DEVICES $SIMULATORS hdbppts-es hdbppts-cm archiver-timescale
make stop device-docker # this one does not test well in docker-in-docker make stop device-docker # this one does not test well in docker-in-docker
make stop elk
# Run dummy integration test to install pytango in tox virtualenv without
# the memory pressure of the ELK stack.
# Alternatively this step can be avoided if we use:
# `tox --sitepackages -e integration` for the integration docker container,
# however, that does require creating a container specific integration job.
# TODO(L2SS-992): Remove me and above documentation
integration_test dummy
make start elk make start elk
# Give elk time to start
# TODO(L2SS-988): Use a nicer more reliable mechanism
sleep 10
# Update the dsconfig # Update the dsconfig
# Do not remove `bash`, otherwise statement ignored by gitlab ci shell! # Do not remove `bash`, otherwise statement ignored by gitlab ci shell!
bash "${LOFAR20_DIR}"/sbin/update_ConfigDb.sh "${LOFAR20_DIR}"/CDB/LOFAR_ConfigDb.json bash "${LOFAR20_DIR}"/sbin/update_ConfigDb.sh "${LOFAR20_DIR}"/CDB/LOFAR_ConfigDb.json
...@@ -113,8 +130,8 @@ make start $DEVICES ...@@ -113,8 +130,8 @@ make start $DEVICES
make start archiver-timescale make start archiver-timescale
# Give devices time to restart # Give devices time to restart
# TODO(Corne Lukken): Use a nicer more reliable mechanism # TODO(L2SS-988): Use a nicer more reliable mechanism
sleep 60 sleep 70
# Give archiver-timescale time to start # Give archiver-timescale time to start
# shellcheck disable=SC2016 # shellcheck disable=SC2016
......
...@@ -166,7 +166,7 @@ if [ ! -z "${1+x}" ] && [ "${1}" != "pull" ]; then ...@@ -166,7 +166,7 @@ if [ ! -z "${1+x}" ] && [ "${1}" != "pull" ]; then
docker pull "${local_url}:latest" || true docker pull "${local_url}:latest" || true
fi fi
make build "${1}" make build "${1}" || exit 1
docker tag "${2}" "${local_url}:${tag}" || docker tag "${2/_/-}" "${local_url}:${tag}" docker tag "${2}" "${local_url}:${tag}" || docker tag "${2/_/-}" "${local_url}:${tag}"
docker push "${local_url}:${tag}" docker push "${local_url}:${tag}"
fi fi
......
importlib-metadata<2.0.0,>=0.12;python_version<"3.8"
sphinx>=4.3.2 # BSD sphinx>=4.3.2 # BSD
sphinx-rtd-theme>=1.0.0 # MIT sphinx-rtd-theme>=1.0.0 # MIT
\ No newline at end of file
...@@ -2,7 +2,10 @@ ...@@ -2,7 +2,10 @@
# order of appearance. Changing the order has an impact on the overall # order of appearance. Changing the order has an impact on the overall
# integration process, which may cause wedges in the gate later. # integration process, which may cause wedges in the gate later.
importlib-metadata<2.0.0,>=0.12;python_version<"3.8"
lofar-station-client@git+https://git.astron.nl/lofar2.0/lofar-station-client@0.6.0 lofar-station-client@git+https://git.astron.nl/lofar2.0/lofar-station-client@0.6.0
numpy
mock
asyncua >= 0.9.90 # LGPLv3 asyncua >= 0.9.90 # LGPLv3
PyMySQL[rsa] >= 1.0.2 # MIT PyMySQL[rsa] >= 1.0.2 # MIT
psycopg2-binary >= 2.9.2 # LGPL psycopg2-binary >= 2.9.2 # LGPL
......
...@@ -3,6 +3,13 @@ ...@@ -3,6 +3,13 @@
Integration tests are separated into multi modules. Each module requires a Integration tests are separated into multi modules. Each module requires a
different state and configuration. These configurations are managed externally. different state and configuration. These configurations are managed externally.
To minimize runtime overhead and memory pressure it is best to execute the
dummy integration test module before any other container is created. This will
ensure pytango is installed in the `.tox/integration` virtual environment
before the system experiences the severe memory pressure of the ELK stack.
Simply run `make integration dummy` from inside the `docker-compose` folder.
In total the orchestration of integration tests is handled through four separate In total the orchestration of integration tests is handled through four separate
layers, each one calling the next: layers, each one calling the next:
...@@ -17,7 +24,7 @@ value can be left empty for the `default` module: ...@@ -17,7 +24,7 @@ value can be left empty for the `default` module:
Individual tests can be invoked using arguments: Individual tests can be invoked using arguments:
`TEST_MODULE=default tox -e integration` `TEST_MODULE=default tox -e integration import.path.class.functionname`
These arguments and modules can also be passed at the level of the Makefile These arguments and modules can also be passed at the level of the Makefile
instead of through tox directly: instead of through tox directly:
...@@ -48,7 +55,7 @@ cd tangostationcontrol ...@@ -48,7 +55,7 @@ cd tangostationcontrol
# Single test to significantly reduce runtime # Single test to significantly reduce runtime
tox -e integration tangostationcontrol.integration_test.default.devices.test_device_digitalbeam.TestDeviceDigitalBeam.test_pointing_to_zenith tox -e integration tangostationcontrol.integration_test.default.devices.test_device_digitalbeam.TestDeviceDigitalBeam.test_pointing_to_zenith
source .tox/integration/bin/activate source .tox/integration/bin/activate
# Add import pdb; pdb.set_trace() somehwere # Add import pdb; pdb.set_trace() somewhere
nano integration tangostationcontrol.integration_test.default.devices.test_device_digitalbeam.py nano integration tangostationcontrol.integration_test.default.devices.test_device_digitalbeam.py
python -m testtools.run tangostationcontrol.integration_test.default.devices.test_device_digitalbeam.TestDeviceDigitalBeam.test_pointing_to_zenith python -m testtools.run tangostationcontrol.integration_test.default.devices.test_device_digitalbeam.TestDeviceDigitalBeam.test_pointing_to_zenith
``` ```
...@@ -71,3 +78,10 @@ are running and are in the required state. ...@@ -71,3 +78,10 @@ are running and are in the required state.
```shell ```shell
sbin/run_integration_test.sh sbin/run_integration_test.sh
``` ```
## Cleanup, recovery or starting over
All docker content including images, containers, networks and volumes can
be deleted using the following:
`docker stop $(docker ps | tail -n+2 | awk '{NF=1}1' | awk '{printf("%s ",$0)} END { printf "\n" }'); docker system prune --all; docker volume prune`
...@@ -41,7 +41,8 @@ class TestDeviceBeamlet(AbstractTestBases.TestDeviceBase): ...@@ -41,7 +41,8 @@ class TestDeviceBeamlet(AbstractTestBases.TestDeviceBase):
sdp_proxy = self.setup_sdp() sdp_proxy = self.setup_sdp()
self.proxy.initialise() self.proxy.initialise()
self.proxy.subband_select = [0] * 488 # TODO(Corne): Update test so effects of attribute are asserted L2SS-984
# self.proxy.subband_select_RW = [0] * 488
self.proxy.on() self.proxy.on()
# The subband frequency of HBA subband 0 is 200 MHz, # The subband frequency of HBA subband 0 is 200 MHz,
...@@ -63,7 +64,8 @@ class TestDeviceBeamlet(AbstractTestBases.TestDeviceBase): ...@@ -63,7 +64,8 @@ class TestDeviceBeamlet(AbstractTestBases.TestDeviceBase):
sdp_proxy = self.setup_sdp() sdp_proxy = self.setup_sdp()
self.proxy.initialise() self.proxy.initialise()
self.proxy.subband_select = list(range(488)) # TODO(Corne): Update test so effects of attribute are asserted L2SS-984
# self.proxy.subband_select_RW = list(range(488))
self.proxy.on() self.proxy.on()
# any non-zero delay should result in different weights for different clocks # any non-zero delay should result in different weights for different clocks
......
...@@ -66,8 +66,9 @@ class TestDeviceDigitalBeam(AbstractTestBases.TestDeviceBase): ...@@ -66,8 +66,9 @@ class TestDeviceDigitalBeam(AbstractTestBases.TestDeviceBase):
antennafield_proxy.put_property({ antennafield_proxy.put_property({
"RECV_devices": [self.recv_iden], "RECV_devices": [self.recv_iden],
"Control_to_RECV_mapping": numpy.array(control_mapping).flatten(), "Control_to_RECV_mapping": numpy.array(control_mapping).flatten(),
'Antenna_Quality': antenna_qualities, 'Antenna_Use': antenna_use} "Antenna_Quality": antenna_qualities,
) "Antenna_Use": antenna_use
})
antennafield_proxy.off() antennafield_proxy.off()
antennafield_proxy.boot() antennafield_proxy.boot()
return antennafield_proxy return antennafield_proxy
...@@ -81,9 +82,10 @@ class TestDeviceDigitalBeam(AbstractTestBases.TestDeviceBase): ...@@ -81,9 +82,10 @@ class TestDeviceDigitalBeam(AbstractTestBases.TestDeviceBase):
self.setup_antennafield_proxy(self.antenna_qualities_ok, self.antenna_use_ok) self.setup_antennafield_proxy(self.antenna_qualities_ok, self.antenna_use_ok)
self.setup_sdp_proxy() self.setup_sdp_proxy()
# TODO(Corne): Update these and ensure their effects is asserted in tests L2SS-984
# Setup beamlet configuration # Setup beamlet configuration
self.beamlet_proxy.clock_RW = 200 * 1000000 # self.beamlet_proxy.clock_RW = 200 * 1000000
self.beamlet_proxy.subband_select = list(range(488)) # self.beamlet_proxy.subband_select_RW = list(range(488))
self.proxy.initialise() self.proxy.initialise()
self.proxy.Tracking_enabled_RW = False self.proxy.Tracking_enabled_RW = False
...@@ -106,10 +108,6 @@ class TestDeviceDigitalBeam(AbstractTestBases.TestDeviceBase): ...@@ -106,10 +108,6 @@ class TestDeviceDigitalBeam(AbstractTestBases.TestDeviceBase):
self.setup_antennafield_proxy(self.antenna_qualities_ok, self.antenna_use_ok) self.setup_antennafield_proxy(self.antenna_qualities_ok, self.antenna_use_ok)
self.setup_sdp_proxy() self.setup_sdp_proxy()
# Setup beamlet configuration
self.beamlet_proxy.clock_RW = 200 * 1000000
self.beamlet_proxy.subband_select = list(range(488))
self.proxy.initialise() self.proxy.initialise()
self.proxy.Tracking_enabled_RW = False self.proxy.Tracking_enabled_RW = False
self.proxy.on() self.proxy.on()
...@@ -140,10 +138,6 @@ class TestDeviceDigitalBeam(AbstractTestBases.TestDeviceBase): ...@@ -140,10 +138,6 @@ class TestDeviceDigitalBeam(AbstractTestBases.TestDeviceBase):
self.setup_antennafield_proxy(self.antenna_qualities_ok, self.antenna_use_ok) self.setup_antennafield_proxy(self.antenna_qualities_ok, self.antenna_use_ok)
self.setup_sdp_proxy() self.setup_sdp_proxy()
# Setup beamlet configuration
self.beamlet_proxy.clock_RW = 200 * 1000000
self.beamlet_proxy.subband_select = list(range(488))
self.proxy.initialise() self.proxy.initialise()
self.proxy.Tracking_enabled_RW = False self.proxy.Tracking_enabled_RW = False
self.proxy.on() self.proxy.on()
......
...@@ -48,6 +48,7 @@ class TestDeviceTemperatureManager(AbstractTestBases.TestDeviceBase): ...@@ -48,6 +48,7 @@ class TestDeviceTemperatureManager(AbstractTestBases.TestDeviceBase):
def test_alarm(self): def test_alarm(self):
# Exclude other devices which raise a TimeoutError, since they wait for the attribute *_translator_busy_R to become False # Exclude other devices which raise a TimeoutError, since they wait for the attribute *_translator_busy_R to become False
# (set instead to True in this test environment) # (set instead to True in this test environment)
self.proxy.put_property({"Alarm_Error_List": ["RECV, HBAT_LED_on_RW"]})
self.proxy.put_property({"Shutdown_Device_List": ["STAT/SDP/1"]}) self.proxy.put_property({"Shutdown_Device_List": ["STAT/SDP/1"]})
devices = [DeviceProxy("STAT/SDP/1")] devices = [DeviceProxy("STAT/SDP/1")]
......
# -*- coding: utf-8 -*-
#
# This file is part of the LOFAR 2.0 Station Software
#
#
#
# Distributed under the terms of the APACHE license.
# See LICENSE.txt for more info.
from tangostationcontrol.integration_test import base
class TestDummy(base.IntegrationTestCase):
def test_dummy(self):
self.assertTrue(True)
...@@ -2,8 +2,11 @@ ...@@ -2,8 +2,11 @@
# order of appearance. Changing the order has an impact on the overall # order of appearance. Changing the order has an impact on the overall
# integration process, which may cause wedges in the gate later. # integration process, which may cause wedges in the gate later.
importlib-metadata<2.0.0,>=0.12;python_version<"3.8"
asynctest>=0.13.0 # Apache-2.0 asynctest>=0.13.0 # Apache-2.0
bandit>=1.6.0 # Apache-2.0 bandit>=1.6.0 # Apache-2.0
virtualenv>=20.16.0 # MIT
build>=0.8.0 # MIT
coverage>=5.2.0 # Apache-2.0 coverage>=5.2.0 # Apache-2.0
doc8>=0.8.0 # Apache-2.0 doc8>=0.8.0 # Apache-2.0
flake8>=3.8.0 # MIT flake8>=3.8.0 # MIT
......
[tox] [tox]
minversion = 3.20 minversion = 3.20
envlist = py37,py38,py39,py310,pep8 envlist = py3{7,8,9,10},pep8
skipsdist = True skipsdist = True
[testenv] [testenv]
usedevelop = True usedevelop = True
; Module access is a bit of an ugly hack. This is due to testenv inheritance ; Python and tox variables are used to access modules and binaries instead of
; with sitepackages = True`, meaning that global packages can be accessed by the ; directly. This makes the setup robust for using sitepackages=True.
; tox environment. Our tango images already have several dependencies system
; wide installed, however, the system wide installation will never look inside
; tox its virtualenv for packages. So accessing stestr and others fail.. We
; can't remove `sitepackages = True` either as we need access to tango and
; installing this package is non-trivial. The solution is to prevent calling
; binaries directly and utilizing python and tox variables to resolve the
; requested module.
sitepackages = True
install_command = {envbindir}/pip3 install {opts} {packages} install_command = {envbindir}/pip3 install {opts} {packages}
passenv = HOME passenv = HOME
setenv = setenv =
VIRTUAL_ENV={envdir} VIRTUAL_ENV={envdir}
PYTHONWARNINGS=default::DeprecationWarning PYTHONWARNINGS=default::DeprecationWarning
; Share the same envdir with as many jobs as possible due to extensive time it
; takes to compile the pytango wheel, in addition to its large install size.
; should the environment change (such as the Python version) the environment
; will automatically be recreated.
envdir = {toxworkdir}/testenv
deps = deps =
-r{toxinidir}/requirements.txt -r{toxinidir}/requirements.txt
-r{toxinidir}/../docker-compose/lofar-device-base/lofar-requirements.txt -r{toxinidir}/../docker-compose/lofar-device-base/lofar-requirements.txt
-r{toxinidir}/test-requirements.txt -r{toxinidir}/test-requirements.txt
commands_pre = commands_pre =
{envpython} --version {envpython} --version
pip install --no-cache pytango
commands = commands =
{envpython} -m stestr --version {envpython} -m stestr --version
{envpython} -m stestr run {posargs} {envpython} -m stestr run {posargs}
; We can't detect the current Python version for an environment dynamically
; so each Python version specific job needs its own envdir.
[testenv:py37]
envdir = {toxworkdir}/testenvpy37
[testenv:py38]
envdir = {toxworkdir}/testenvpy38
[testenv:py39]
envdir = {toxworkdir}/testenvpy39
[testenv:py310]
envdir = {toxworkdir}/testenvpy310
[testenv:integration] [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 allowlist_externals = echo
passenv = TANGO_HOST passenv = TANGO_HOST
setenv = setenv =
...@@ -55,10 +65,6 @@ commands = ...@@ -55,10 +65,6 @@ commands =
setenv = setenv =
VIRTUAL_ENV={envdir} VIRTUAL_ENV={envdir}
PYTHON={envpython} -m coverage run --source tangostationcontrol --parallel-mode PYTHON={envpython} -m coverage run --source tangostationcontrol --parallel-mode
deps =
-r{toxinidir}/requirements.txt
-r{toxinidir}/../docker-compose/lofar-device-base/lofar-requirements.txt
-r{toxinidir}/test-requirements.txt
commands = commands =
{envpython} -m stestr --version {envpython} -m stestr --version
{envpython} -m coverage --version {envpython} -m coverage --version
...@@ -91,7 +97,12 @@ commands = ...@@ -91,7 +97,12 @@ commands =
{envpython} -m xenon --version {envpython} -m xenon --version
{envpython} -m xenon tangostationcontrol -b B -m A -a A -i libhdbpp-python {envpython} -m xenon tangostationcontrol -b B -m A -a A -i libhdbpp-python
[testenv:build]
usedevelop = False
commands = {envpython} -m build
[testenv:docs] [testenv:docs]
envdir = {toxworkdir}/docs
deps = deps =
-r{toxinidir}/../docker-compose/lofar-device-base/lofar-requirements.txt -r{toxinidir}/../docker-compose/lofar-device-base/lofar-requirements.txt
-r{toxinidir}/docs/docs-requirements.txt -r{toxinidir}/docs/docs-requirements.txt
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment