diff --git a/doc/version-history.rst b/doc/version-history.rst index 90389eb0..a298155b 100644 --- a/doc/version-history.rst +++ b/doc/version-history.rst @@ -10,6 +10,13 @@ Version History .. No new work should be required in order to complete this section. .. Below is an example of a version history format. +v0.28.0 +------- +* Removed MainTel Camera state transition scripts and configs. +* Add MTRotator to ignore list in enabled_offline_state_transition_configs.py. +* Moved the callback definition in base_script.py. +* Fixed an empty-config definition. + v0.27.0 ------- * Fixed CSC list to remove indexed instances of OCPS. diff --git a/python/lsst/ts/IntegrationTests/auxtel_housekeeping.py b/python/lsst/ts/IntegrationTests/auxtel_housekeeping.py index b708620d..9b03500f 100644 --- a/python/lsst/ts/IntegrationTests/auxtel_housekeeping.py +++ b/python/lsst/ts/IntegrationTests/auxtel_housekeeping.py @@ -38,7 +38,7 @@ class AuxTelHousekeeping(BaseScript): index: int = 2 configs: tuple = ( - [], + "", registry["atdome_home"], registry["atdome_park"], registry["atptg_park"], diff --git a/python/lsst/ts/IntegrationTests/base_script.py b/python/lsst/ts/IntegrationTests/base_script.py index 8c1322aa..8d670241 100644 --- a/python/lsst/ts/IntegrationTests/base_script.py +++ b/python/lsst/ts/IntegrationTests/base_script.py @@ -184,9 +184,6 @@ async def run(self) -> None: # Since `async with` is used, # you do NOT have to wait for the remote to start - # Create the callback to the ScriptQueue Script Event that - # will wait for all the scripts to complete. - self.remote.evt_script.callback = self.wait_for_done # Convert the queue_placement parameter to the approprirate # ScriptQueue.Location Enum object. queue_placement = getattr(Location, self.queue_placement.upper()) @@ -213,6 +210,9 @@ async def run(self) -> None: # Copy the script_indexes list to use in the Script Event callback. # This maintains the integrity of the real script_indexes list. self.temp_script_indexes = copy.deepcopy(script_indexes) + # Create the callback to the ScriptQueue Script Event that + # will wait for all the scripts to complete. + self.remote.evt_script.callback = self.wait_for_done # Resume the ScriptQueue to begin script execution. await self.remote.cmd_resume.set_start(timeout=10) # Wait for the scripts to complete. diff --git a/python/lsst/ts/IntegrationTests/configs/enabled_offline_state_transition_configs.py b/python/lsst/ts/IntegrationTests/configs/enabled_offline_state_transition_configs.py index 7d16333a..f0ad8fdd 100644 --- a/python/lsst/ts/IntegrationTests/configs/enabled_offline_state_transition_configs.py +++ b/python/lsst/ts/IntegrationTests/configs/enabled_offline_state_transition_configs.py @@ -105,6 +105,7 @@ """ ignore: - mtptg + - mtrotator """ ) @@ -126,19 +127,6 @@ yaml_string, explicit_start=True, canonical=True ) -# MainTel Camera enabled_offline -yaml_string = yaml.safe_load( - """ - data: - - [MTHeaderService, OFFLINE] - - [MTOODS, OFFLINE] - """ -) - -registry["maintel_camera_enabled_offline"] = yaml.safe_dump( - yaml_string, explicit_start=True, canonical=True -) - # GenCam enabled_offline yaml_string = yaml.safe_load( """ diff --git a/python/lsst/ts/IntegrationTests/configs/maintel_state_transition_configs.py b/python/lsst/ts/IntegrationTests/configs/maintel_state_transition_configs.py index 2e6543f5..d274c1f9 100644 --- a/python/lsst/ts/IntegrationTests/configs/maintel_state_transition_configs.py +++ b/python/lsst/ts/IntegrationTests/configs/maintel_state_transition_configs.py @@ -81,16 +81,3 @@ registry["maintel_disabled_enabled"] = yaml.safe_dump( yaml_string, explicit_start=True, canonical=True ) - -# maintel_camera_disabled_enabled -yaml_string = yaml.safe_load( - """ - data: - - [replace_me_HeaderService, ENABLED] - - [replace_me_OODS, ENABLED] - """ -) - -registry["maintel_camera_disabled_enabled"] = yaml.safe_dump( - yaml_string, explicit_start=True, canonical=True -) diff --git a/python/lsst/ts/IntegrationTests/enabled_offline.py b/python/lsst/ts/IntegrationTests/enabled_offline.py index 8a5d330d..5365ccc0 100644 --- a/python/lsst/ts/IntegrationTests/enabled_offline.py +++ b/python/lsst/ts/IntegrationTests/enabled_offline.py @@ -45,7 +45,6 @@ class EnabledOffline(BaseScript): registry["mtcs_enabled_offline"], registry["eas_enabled_offline"], registry["maintel_enabled_offline"], - registry["maintel_camera_enabled_offline"], registry["gencam_enabled_offline"], # The ScriptQueue script must run last. registry["sq_enabled_offline"], @@ -60,7 +59,6 @@ class EnabledOffline(BaseScript): ("set_summary_state.py", BaseScript.is_standard), ("set_summary_state.py", BaseScript.is_standard), ("set_summary_state.py", BaseScript.is_standard), - ("set_summary_state.py", BaseScript.is_standard), ] def __init__(self) -> None: diff --git a/python/lsst/ts/IntegrationTests/maintel_disabled_enabled.py b/python/lsst/ts/IntegrationTests/maintel_disabled_enabled.py index d5c939d6..8ca96f3b 100644 --- a/python/lsst/ts/IntegrationTests/maintel_disabled_enabled.py +++ b/python/lsst/ts/IntegrationTests/maintel_disabled_enabled.py @@ -24,11 +24,9 @@ import asyncio -import yaml from lsst.ts.IntegrationTests import BaseScript from .configs.config_registry import registry -from .utils import get_test_env_arg class MainTelDisabledEnabled(BaseScript): @@ -39,56 +37,22 @@ class MainTelDisabledEnabled(BaseScript): """ index: int = 1 - configs: tuple = ( - registry["maintel_disabled_enabled"], - registry["maintel_camera_disabled_enabled"], - ) + configs: tuple = (registry["maintel_disabled_enabled"],) scripts: list = [ ("set_summary_state.py", BaseScript.is_standard), - ("set_summary_state.py", BaseScript.is_standard), ] - def __init__(self, test_env: str) -> None: + def __init__(self) -> None: super().__init__() - # Set the MainTel Camera based on the test environment. - self.test_env = test_env - self.big_cam_configs = yaml.safe_load( - registry["maintel_camera_disabled_enabled"] - ) - if test_env.lower() == "bts": - # Running on BTS with MTCamera - self.big_cam_hs = "MTHeaderService" - self.big_cam_oods = "MTOODS" - else: - # Running on TTS or Summit with CCCamera - self.big_cam_hs = "CCHeaderService" - self.big_cam_oods = "CCOODS" - self.big_cam_configs["data"][0][0] = self.big_cam_hs - self.big_cam_configs["data"][1][0] = self.big_cam_oods - self.configs = ( - registry["maintel_disabled_enabled"], - yaml.safe_dump(self.big_cam_configs), - ) def run_maintel_disabled_enabled() -> None: - # Ensure the invocation is correct. - # If not, raise KeyError. - # If it is correct, execute the state transition. - args = get_test_env_arg() - try: - script_class = MainTelDisabledEnabled( - test_env=args.test_env, - ) - except KeyError as ke: - print(repr(ke)) - else: - num_scripts = len(script_class.scripts) - print( - f"\nMainTel Disabled to Enabled; " - f"running {num_scripts} scripts" - f"on the '{args.test_env}' environment, " - f"with this configuration: \n" - f"{script_class.configs}" - ) + script_class = MainTelDisabledEnabled() + num_scripts = len(script_class.scripts) + print( + f"\nMainTel Disabled to Enabled; " + f"running {num_scripts} scripts" + f"with this configuration: \n" + f"{script_class.configs}" + ) asyncio.run(script_class.run()) diff --git a/python/lsst/ts/IntegrationTests/maintel_standby_disabled.py b/python/lsst/ts/IntegrationTests/maintel_standby_disabled.py index 7016563d..c9bdf387 100644 --- a/python/lsst/ts/IntegrationTests/maintel_standby_disabled.py +++ b/python/lsst/ts/IntegrationTests/maintel_standby_disabled.py @@ -24,11 +24,9 @@ import asyncio -import yaml from lsst.ts.IntegrationTests import BaseScript from .configs.config_registry import registry -from .utils import get_test_env_arg class MainTelStandbyDisabled(BaseScript): @@ -39,56 +37,22 @@ class MainTelStandbyDisabled(BaseScript): """ index: int = 1 - configs: tuple = ( - registry["maintel_standby_disabled"], - registry["maintel_camera_standby_disabled"], - ) + configs: tuple = (registry["maintel_standby_disabled"],) scripts: list = [ ("set_summary_state.py", BaseScript.is_standard), - ("set_summary_state.py", BaseScript.is_standard), ] - def __init__(self, test_env: str) -> None: + def __init__(self) -> None: super().__init__() - # Set the MainTel Camera based on the test environment. - self.test_env = test_env - self.big_cam_configs = yaml.safe_load( - registry["maintel_camera_standby_disabled"] - ) - if test_env.lower() == "bts": - # Running on BTS with MTCamera - self.big_cam_hs = "MTHeaderService" - self.big_cam_oods = "MTOODS" - else: - # Running on TTS or Summit with CCCamera - self.big_cam_hs = "CCHeaderService" - self.big_cam_oods = "CCOODS" - self.big_cam_configs["data"][0][0] = self.big_cam_hs - self.big_cam_configs["data"][1][0] = self.big_cam_oods - self.configs = ( - registry["maintel_standby_disabled"], - yaml.safe_dump(self.big_cam_configs), - ) def run_maintel_standby_disabled() -> None: - # Ensure the invocation is correct. - # If not, raise KeyError. - # If it is correct, execute the state transition. - args = get_test_env_arg() - try: - script_class = MainTelStandbyDisabled( - test_env=args.test_env, - ) - except KeyError as ke: - print(repr(ke)) - else: - num_scripts = len(script_class.scripts) - print( - f"\nMainTel Standby to Disabled; " - f"running {num_scripts} scripts " - f"on the '{args.test_env}' environment, " - f"with this configuration: \n" - f"{script_class.configs}" - ) - asyncio.run(script_class.run()) + script_class = MainTelStandbyDisabled() + num_scripts = len(script_class.scripts) + print( + f"\nMainTel Standby to Disabled; " + f"running {num_scripts} scripts " + f"with this configuration: \n" + f"{script_class.configs}" + ) + asyncio.run(script_class.run()) diff --git a/tests/test_enabled_offline.py b/tests/test_enabled_offline.py index fe3ebba5..04835eb1 100644 --- a/tests/test_enabled_offline.py +++ b/tests/test_enabled_offline.py @@ -59,7 +59,7 @@ async def test_enabled_offline(self) -> None: # Assert script was added to ScriptQueue. self.assertEqual(len(self.controller.queue_list), num_scripts) # Assert scripts passed. - self.assertEqual(script_class.script_states, [8, 8, 8, 8, 8, 8, 8, 8, 8, 8]) + self.assertEqual(script_class.script_states, [8, 8, 8, 8, 8, 8, 8, 8, 8]) async def asyncTearDown(self) -> None: await self.controller.close() diff --git a/tests/test_maintel_state_transitions.py b/tests/test_maintel_state_transitions.py index 638c26a7..77fccf7a 100644 --- a/tests/test_maintel_state_transitions.py +++ b/tests/test_maintel_state_transitions.py @@ -52,7 +52,7 @@ async def test_maintel_standby_disabled(self) -> None: """ # Instantiate the MainTelStandbyDisabled integration tests. - script_class = MainTelStandbyDisabled(test_env="bts") + script_class = MainTelStandbyDisabled() # Get number of scripts num_scripts = len(script_class.scripts) print(f"MainTel Standby to Disabled; running {num_scripts} scripts") @@ -61,7 +61,7 @@ async def test_maintel_standby_disabled(self) -> None: # Assert script was added to ScriptQueue. self.assertEqual(len(self.controller.queue_list), num_scripts) # Assert scripts passed. - self.assertEqual(script_class.script_states, [8, 8]) + self.assertEqual(script_class.script_states, [8]) async def test_maintel_disabled_enabled(self) -> None: """Execute the MainTelDisabledEnabled integration test script, @@ -71,7 +71,7 @@ async def test_maintel_disabled_enabled(self) -> None: """ # Instantiate the MainTelDisabledEnabled integration tests. - script_class = MainTelDisabledEnabled(test_env="tts") + script_class = MainTelDisabledEnabled() # Get number of scripts num_scripts = len(script_class.scripts) print(f"MainTel Disabled to Enabled; running {num_scripts} scripts") @@ -80,7 +80,7 @@ async def test_maintel_disabled_enabled(self) -> None: # Assert script was added to ScriptQueue. self.assertEqual(len(self.controller.queue_list), num_scripts) # Assert scripts passed. - self.assertEqual(script_class.script_states, [8, 8]) + self.assertEqual(script_class.script_states, [8]) async def asyncTearDown(self) -> None: await self.controller.close()