Skip to content

Commit 844c37d

Browse files
committed
addressed comments
1 parent 23c8d57 commit 844c37d

File tree

4 files changed

+99
-203
lines changed

4 files changed

+99
-203
lines changed

tests/e2e/features/environment.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -552,7 +552,9 @@ def after_feature(context: Context, feature: Feature) -> None:
552552
restart_container("lightspeed-stack")
553553
remove_config_backup(context.default_config_backup)
554554

555-
# Restore Lightspeed Stack config if the generic configure_service step switched it
555+
# Restore Lightspeed Stack config if the generic configure_service step switched it.
556+
# This cleanup intentionally runs for any feature (not tag-gated) - any feature that
557+
# leaves a backup file will trigger config restoration and container restarts.
556558
backup_path = "lightspeed-stack.yaml.backup"
557559
if os.path.exists(backup_path):
558560
switch_config(backup_path)

tests/e2e/features/steps/proxy.py

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -137,22 +137,9 @@ def restore_if_modified(context: Context) -> None:
137137
_stop_proxy(context, "tunnel_proxy", "proxy_loop")
138138
_stop_proxy(context, "interception_proxy", "interception_proxy_loop")
139139

140-
# Check for backups from both proxy and TLS scenarios
141-
_LLAMA_STACK_TLS_BACKUP = "run.yaml.tls-backup"
142-
backup_to_restore = None
143140
if os.path.exists(_LLAMA_STACK_CONFIG_BACKUP):
144-
backup_to_restore = _LLAMA_STACK_CONFIG_BACKUP
145-
elif os.path.exists(_LLAMA_STACK_TLS_BACKUP):
146-
backup_to_restore = _LLAMA_STACK_TLS_BACKUP
147-
148-
if backup_to_restore:
149-
print(f"Restoring original Llama Stack config from {backup_to_restore}...")
150-
shutil.copy(backup_to_restore, _LLAMA_STACK_CONFIG)
151-
os.remove(backup_to_restore)
152-
# Clean up the other backup too if it exists
153-
for other_backup in [_LLAMA_STACK_CONFIG_BACKUP, _LLAMA_STACK_TLS_BACKUP]:
154-
if other_backup != backup_to_restore and os.path.exists(other_backup):
155-
os.remove(other_backup)
141+
print(f"Restoring original Llama Stack config from {_LLAMA_STACK_CONFIG_BACKUP}...")
142+
shutil.move(_LLAMA_STACK_CONFIG_BACKUP, _LLAMA_STACK_CONFIG)
156143
restart_container("llama-stack")
157144
restart_container("lightspeed-stack")
158145

0 commit comments

Comments
 (0)