From 661f109448b2806170c177582566fcda9dc395f6 Mon Sep 17 00:00:00 2001 From: lukken <lukken@astron.nl> Date: Fri, 4 Nov 2022 06:24:13 +0000 Subject: [PATCH] L2SS-938: Interactively start and stop code coverage --- tangostationcontrol/start.py | 5 ++++- tangostationcontrol/store.py | 28 ++++++++++++++++++++++++++++ tangostationcontrol/tox.ini | 6 +++++- 3 files changed, 37 insertions(+), 2 deletions(-) create mode 100755 tangostationcontrol/store.py diff --git a/tangostationcontrol/start.py b/tangostationcontrol/start.py index e6fd41c77..196717553 100644 --- a/tangostationcontrol/start.py +++ b/tangostationcontrol/start.py @@ -22,4 +22,7 @@ devices = [ for device in devices: d = DeviceProxy(device) - d.start_coverage() + try: + d.start_coverage() + except Exception: + pass diff --git a/tangostationcontrol/store.py b/tangostationcontrol/store.py new file mode 100755 index 000000000..e839ed56f --- /dev/null +++ b/tangostationcontrol/store.py @@ -0,0 +1,28 @@ +from tango import DeviceProxy + +devices = [ + # "STAT/Docker/1", # Docker controls the device containers, so it goes before anything else + "STAT/PSOC/1", # PSOC boot early to detect power delivery failure as fast as possible + "STAT/PCON/1", # PCON boot early because it is responsible for power delivery. + "STAT/APSPU/1", # APS Power Units control other hardware we want to initialise + "STAT/APSCT/1", + "STAT/CCD/1", + "STAT/RECV/1", # RCUs are input for SDP, so initialise them first + "STAT/UNB2/1", # Uniboards host SDP, so initialise them first + "STAT/SDP/1", # SDP controls the mask for SST/XST/BST/Beamlet, so initialise it first + "STAT/BST/1", + "STAT/SST/1", + "STAT/XST/1", + "STAT/Beamlet/1", + "STAT/AntennaField/1", # Accesses RECV + "STAT/TileBeam/1", # Accesses AntennaField + "STAT/DigitalBeam/1", # Accessed SDP and Beamlet + "STAT/TemperatureManager/1", +] + +for device in devices: + d = DeviceProxy(device) + try: + d.store_coverage() + except Exception: + pass diff --git a/tangostationcontrol/tox.ini b/tangostationcontrol/tox.ini index 73fe8ba9f..710617674 100644 --- a/tangostationcontrol/tox.ini +++ b/tangostationcontrol/tox.ini @@ -47,17 +47,21 @@ basepython=python3.7 commands = {envpython} -m testtools.run {posargs} [testenv:integration] -allowlist_externals = echo +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 +ignore_errors = true commands = echo "Integration test directory configured for{env:TESTS_DIR} ({env:TEST_MODULE:default})" {envpython} -m stestr --version {envpython} -m coverage --version + {envpython} start.py {envpython} -m stestr run --serial {posargs} + {envpython} store.py {envpython} -m coverage combine {envpython} -m coverage html --omit='*test*' -d cover {envpython} -m coverage xml -o coverage.xml -- GitLab