fix(pyright): resolve type errors introduced by lifecycle refactor
tracker-policy-pr / check-pr (pull_request) Successful in 15s
test / integration-docker (pull_request) Successful in 28s
test / unit (pull_request) Successful in 39s
lint / lint (push) Successful in 42s
test / stage-firecracker-inputs (pull_request) Successful in 2s
test / build-infra (pull_request) Successful in 3m39s
test / integration-firecracker (pull_request) Successful in 1m49s
test / coverage (pull_request) Failing after 2m4s
test / publish-infra (pull_request) Has been skipped

- Remove unused INFRA_IMAGE import from test_orchestrator_lifecycle
- Update integration test to use new single-container OrchestratorService
  API (infra_name/image replaces orchestrator_name/gateway_name/gateway_image)
- Move type: ignore to the lambda line in gateway_init SIGHUP handler
- Break two long lines in test_orchestrator_lifecycle
This commit is contained in:
2026-07-20 19:48:52 +00:00
parent 5b8c8ceb1d
commit e712967df5
3 changed files with 18 additions and 16 deletions
+6 -3
View File
@@ -10,7 +10,6 @@ from unittest.mock import MagicMock, Mock, patch
from bot_bottle.orchestrator.lifecycle import (
INFRA_NAME,
INFRA_IMAGE,
INFRA_SOURCE_HASH_LABEL,
OrchestratorService,
OrchestratorStartError,
@@ -113,7 +112,8 @@ class TestOrchestratorService(unittest.TestCase):
# Both processes in one container — no separate entrypoint override.
self.assertNotIn("--entrypoint", argv)
# Gateway daemons + orchestrator explicitly opted in.
self.assertIn("orchestrator", argv[argv.index("BOT_BOTTLE_GATEWAY_DAEMONS=egress,git-http,supervise,orchestrator")])
daemons_flag = "BOT_BOTTLE_GATEWAY_DAEMONS=egress,git-http,supervise,orchestrator"
self.assertIn("orchestrator", argv[argv.index(daemons_flag)])
def test_ensure_running_builds_both_images(self) -> None:
calls: list[list[str]] = []
@@ -147,7 +147,10 @@ class TestOrchestratorService(unittest.TestCase):
def test_stop_removes_infra_container(self) -> None:
with patch(_RUN) as run:
self.svc.stop()
rms = [c.args[0] for c in run.call_args_list if c.args[0][:3] == ["docker", "rm", "--force"]]
rms = [
c.args[0] for c in run.call_args_list
if c.args[0][:3] == ["docker", "rm", "--force"]
]
self.assertTrue(any(INFRA_NAME in a for a in rms))