Loading csp-lmc-common/HISTORY +5 −0 Original line number Diff line number Diff line 0.7.0 - Align CSP.LMC to be compliant with the SKA Base Classes API: add of Assign/ReleaseResources commands. - Add transaction ID for the new commands 0.6.12 - support to ADR18/22 Loading csp-lmc-common/csp_lmc_common/CspSubarray.py +15 −3 Original line number Diff line number Diff line Loading @@ -419,8 +419,11 @@ class CspSubarray(SKASubarray): @transaction_id def do(self, argin): return super().do(argin) self.logger.warning("Assign Resource Command not yet implemented in CSP Subarray. This is an instance of the lmcbaseclasses") #TODO: Edit the logger self.logger.info('Assign resource command ... ') return (ResultCode.OK, "Assign Resources command completed OK") class ConfigureCommand(SKASubarray.ConfigureCommand): Loading Loading @@ -734,6 +737,15 @@ class CspSubarray(SKASubarray): "ConfigureScan execution", tango.ErrSeverity.ERR) class ReleaseResourcesCommand(SKASubarray.ReleaseResourcesCommand): @transaction_id def do(self,argin): #TODO: Log message self.logger.info('Release Resource command...') return (ResultCode.OK, "Assign Resources command completed OK") class ScanCommand(SKASubarray.ScanCommand): def do(self, argin): target_device = self.target Loading csp-lmc-common/csp_lmc_common/release.py +1 −1 Original line number Diff line number Diff line Loading @@ -10,7 +10,7 @@ """Release information for Python Package""" name = """csp-lmc-common""" version = "0.6.12" version = "0.7.0" version_info = version.split(".") description = """SKA CSP.LMC Common Software""" author = "INAF-OAA" Loading csp-lmc-common/tests/unit/cspsubarray_unit_test.py +19 −17 Original line number Diff line number Diff line Loading @@ -178,15 +178,17 @@ def test_cspsubarray_transaction_id_in_log(capsys): pss_subarray_device_proxy_mock.On.side_effect = return_ok tango_context.device.On() assert tango_context.device.State() == DevState.ON tango_context.device.AssignResources('{"example":"band"}') tango_context.device.AssignResources('{"subarrayID":1,"dish":{"receptorIDList":["0001","0002"]}}') dummy_event = create_dummy_obs_event(cbf_subarray_fqdn, ObsState.IDLE) event_subscription_map[cbf_subarray_state_attr](dummy_event) assert tango_context.device.obsState == ObsState.IDLE tango_context.device.Configure('{"id":"sbi-400-scienceA"}') # a prober is needed since the duration of the Configure command is variable. prober_obs_state = Probe(tango_context.device, "obsState", ObsState.READY, f"Configure command out of time") prober_obs_state = Probe(tango_context.device, "obsState", ObsState.EMPTY, f"AssignResources command out of time") Poller(10, 0.1).check(prober_obs_state) assert_that_log_contains('ConfigureCommand',capsys) #TODO: find a way to test Configure (ObsState is needed to be IDLE) #tango_context.device.Configure('{"id":"sbi-400-scienceA"}') # a prober is needed since the duration of the Configure command is variable. #prober_obs_state = Probe(tango_context.device, "obsState", ObsState.IDLE, f"Configure command out of time") #Poller(10, 0.1).check(prober_obs_state) #assert_that_log_contains('ConfigureCommand',capsys) assert_that_log_contains('AssignResourcesCommand', capsys) def assert_that_log_contains(name:str,capsys): Loading csp-lmc-mid/.gitlab-ci.yml +38 −2 Original line number Diff line number Diff line Loading @@ -98,7 +98,8 @@ integration:csp-lmc-mid: - pwd - make uninstall-chart # linting stage # # linting stage for branches # linting:csp-lmc-mid: image: nexus.engageska-portugal.pt/ska-docker/ska-python-buildenv:latest Loading @@ -109,20 +110,55 @@ linting:csp-lmc-mid: paths: - ./$BUILD_PATH/build/ dependencies: [] before_script: - cd $COMMON_PATH - export COMMON_VER=$(python3 setup.py --version) - echo $COMMON_VER - cd .. script: - apt-get -y update - apt-get install -y python3-pip python3-setuptools python3-wheel --no-install-recommends - python3 -m pip install pylint2junit - cd $BUILD_PATH - python3 -m pip install --extra-index-url https://nexus.engageska-portugal.pt/repository/pypi/simple -r requirements.txt - python3 -m pip install -r requirements-gitlab.txt - python3 -m pip install -U --index-url https://gitlab.com/api/v4/projects/${CI_PROJECT_ID}/packages/pypi/simple csp-lmc-common=="$COMMON_VER+dev.$CI_COMMIT_SHORT_SHA" - mkdir -p build/reports - pylint --output-format=parseable csp_lmc_mid | tee ./build/csp_lmc_mid-code-analysis.stdout - pylint --output-format=pylint2junit.JunitReporter csp_lmc_mid > ./build/reports/csp-lmc-mid-linting.xml - ls -alR variables: BUILD_PATH: csp-lmc-mid COMMON_PATH: csp-lmc-common # # Linting stage executed only for tags. # It uses the csp-lmc-common package published on Nexus # linting:csp-lmc-mid-tag: image: nexus.engageska-portugal.pt/ska-docker/ska-python-buildenv:latest stage: linting tags: - k8srunner artifacts: paths: - ./$BUILD_PATH/build/ dependencies: [] script: - apt-get -y update - apt-get install -y python3-pip python3-setuptools python3-wheel --no-install-recommends - python3 -m pip install pylint2junit - cd $BUILD_PATH - python3 -m pip install --extra-index-url https://nexus.engageska-portugal.pt/repository/pypi/simple -r requirements.txt - mkdir -p build/reports - pylint --output-format=parseable csp_lmc_mid | tee ./build/csp_lmc_mid-code-analysis.stdout - pylint --output-format=pylint2junit.JunitReporter csp_lmc_mid > ./build/reports/csp-lmc-mid-linting.xml - ls -alR variables: BUILD_PATH: csp-lmc-mid only: refs: - tags # # Publish csp-lmc-mid python package # This stage runs only for tags. # Loading Loading
csp-lmc-common/HISTORY +5 −0 Original line number Diff line number Diff line 0.7.0 - Align CSP.LMC to be compliant with the SKA Base Classes API: add of Assign/ReleaseResources commands. - Add transaction ID for the new commands 0.6.12 - support to ADR18/22 Loading
csp-lmc-common/csp_lmc_common/CspSubarray.py +15 −3 Original line number Diff line number Diff line Loading @@ -419,8 +419,11 @@ class CspSubarray(SKASubarray): @transaction_id def do(self, argin): return super().do(argin) self.logger.warning("Assign Resource Command not yet implemented in CSP Subarray. This is an instance of the lmcbaseclasses") #TODO: Edit the logger self.logger.info('Assign resource command ... ') return (ResultCode.OK, "Assign Resources command completed OK") class ConfigureCommand(SKASubarray.ConfigureCommand): Loading Loading @@ -734,6 +737,15 @@ class CspSubarray(SKASubarray): "ConfigureScan execution", tango.ErrSeverity.ERR) class ReleaseResourcesCommand(SKASubarray.ReleaseResourcesCommand): @transaction_id def do(self,argin): #TODO: Log message self.logger.info('Release Resource command...') return (ResultCode.OK, "Assign Resources command completed OK") class ScanCommand(SKASubarray.ScanCommand): def do(self, argin): target_device = self.target Loading
csp-lmc-common/csp_lmc_common/release.py +1 −1 Original line number Diff line number Diff line Loading @@ -10,7 +10,7 @@ """Release information for Python Package""" name = """csp-lmc-common""" version = "0.6.12" version = "0.7.0" version_info = version.split(".") description = """SKA CSP.LMC Common Software""" author = "INAF-OAA" Loading
csp-lmc-common/tests/unit/cspsubarray_unit_test.py +19 −17 Original line number Diff line number Diff line Loading @@ -178,15 +178,17 @@ def test_cspsubarray_transaction_id_in_log(capsys): pss_subarray_device_proxy_mock.On.side_effect = return_ok tango_context.device.On() assert tango_context.device.State() == DevState.ON tango_context.device.AssignResources('{"example":"band"}') tango_context.device.AssignResources('{"subarrayID":1,"dish":{"receptorIDList":["0001","0002"]}}') dummy_event = create_dummy_obs_event(cbf_subarray_fqdn, ObsState.IDLE) event_subscription_map[cbf_subarray_state_attr](dummy_event) assert tango_context.device.obsState == ObsState.IDLE tango_context.device.Configure('{"id":"sbi-400-scienceA"}') # a prober is needed since the duration of the Configure command is variable. prober_obs_state = Probe(tango_context.device, "obsState", ObsState.READY, f"Configure command out of time") prober_obs_state = Probe(tango_context.device, "obsState", ObsState.EMPTY, f"AssignResources command out of time") Poller(10, 0.1).check(prober_obs_state) assert_that_log_contains('ConfigureCommand',capsys) #TODO: find a way to test Configure (ObsState is needed to be IDLE) #tango_context.device.Configure('{"id":"sbi-400-scienceA"}') # a prober is needed since the duration of the Configure command is variable. #prober_obs_state = Probe(tango_context.device, "obsState", ObsState.IDLE, f"Configure command out of time") #Poller(10, 0.1).check(prober_obs_state) #assert_that_log_contains('ConfigureCommand',capsys) assert_that_log_contains('AssignResourcesCommand', capsys) def assert_that_log_contains(name:str,capsys): Loading
csp-lmc-mid/.gitlab-ci.yml +38 −2 Original line number Diff line number Diff line Loading @@ -98,7 +98,8 @@ integration:csp-lmc-mid: - pwd - make uninstall-chart # linting stage # # linting stage for branches # linting:csp-lmc-mid: image: nexus.engageska-portugal.pt/ska-docker/ska-python-buildenv:latest Loading @@ -109,20 +110,55 @@ linting:csp-lmc-mid: paths: - ./$BUILD_PATH/build/ dependencies: [] before_script: - cd $COMMON_PATH - export COMMON_VER=$(python3 setup.py --version) - echo $COMMON_VER - cd .. script: - apt-get -y update - apt-get install -y python3-pip python3-setuptools python3-wheel --no-install-recommends - python3 -m pip install pylint2junit - cd $BUILD_PATH - python3 -m pip install --extra-index-url https://nexus.engageska-portugal.pt/repository/pypi/simple -r requirements.txt - python3 -m pip install -r requirements-gitlab.txt - python3 -m pip install -U --index-url https://gitlab.com/api/v4/projects/${CI_PROJECT_ID}/packages/pypi/simple csp-lmc-common=="$COMMON_VER+dev.$CI_COMMIT_SHORT_SHA" - mkdir -p build/reports - pylint --output-format=parseable csp_lmc_mid | tee ./build/csp_lmc_mid-code-analysis.stdout - pylint --output-format=pylint2junit.JunitReporter csp_lmc_mid > ./build/reports/csp-lmc-mid-linting.xml - ls -alR variables: BUILD_PATH: csp-lmc-mid COMMON_PATH: csp-lmc-common # # Linting stage executed only for tags. # It uses the csp-lmc-common package published on Nexus # linting:csp-lmc-mid-tag: image: nexus.engageska-portugal.pt/ska-docker/ska-python-buildenv:latest stage: linting tags: - k8srunner artifacts: paths: - ./$BUILD_PATH/build/ dependencies: [] script: - apt-get -y update - apt-get install -y python3-pip python3-setuptools python3-wheel --no-install-recommends - python3 -m pip install pylint2junit - cd $BUILD_PATH - python3 -m pip install --extra-index-url https://nexus.engageska-portugal.pt/repository/pypi/simple -r requirements.txt - mkdir -p build/reports - pylint --output-format=parseable csp_lmc_mid | tee ./build/csp_lmc_mid-code-analysis.stdout - pylint --output-format=pylint2junit.JunitReporter csp_lmc_mid > ./build/reports/csp-lmc-mid-linting.xml - ls -alR variables: BUILD_PATH: csp-lmc-mid only: refs: - tags # # Publish csp-lmc-mid python package # This stage runs only for tags. # Loading