Skip to content

Commit

Permalink
Merge pull request #131 from lsst-ts/develop
Browse files Browse the repository at this point in the history
v0.28.0 Release
  • Loading branch information
rbovill authored Sep 25, 2024
2 parents 2d3d6e1 + a20f368 commit 650c46c
Show file tree
Hide file tree
Showing 10 changed files with 38 additions and 130 deletions.
7 changes: 7 additions & 0 deletions doc/version-history.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion python/lsst/ts/IntegrationTests/auxtel_housekeeping.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class AuxTelHousekeeping(BaseScript):

index: int = 2
configs: tuple = (
[],
"",
registry["atdome_home"],
registry["atdome_park"],
registry["atptg_park"],
Expand Down
6 changes: 3 additions & 3 deletions python/lsst/ts/IntegrationTests/base_script.py
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand All @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@
"""
ignore:
- mtptg
- mtrotator
"""
)

Expand All @@ -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(
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
2 changes: 0 additions & 2 deletions python/lsst/ts/IntegrationTests/enabled_offline.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"],
Expand All @@ -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:
Expand Down
56 changes: 10 additions & 46 deletions python/lsst/ts/IntegrationTests/maintel_disabled_enabled.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -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())
58 changes: 11 additions & 47 deletions python/lsst/ts/IntegrationTests/maintel_standby_disabled.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -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())
2 changes: 1 addition & 1 deletion tests/test_enabled_offline.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
8 changes: 4 additions & 4 deletions tests/test_maintel_state_transitions.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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,
Expand All @@ -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")
Expand All @@ -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()
Expand Down

0 comments on commit 650c46c

Please sign in to comment.