fix(macos-container): support git-gate launch
lint / lint (push) Successful in 1m56s
test / unit (pull_request) Successful in 41s
test / integration (pull_request) Successful in 22s

This commit is contained in:
2026-06-10 21:53:22 -04:00
parent 5498f20547
commit 0e823d2aff
6 changed files with 280 additions and 24 deletions
+23
View File
@@ -21,6 +21,7 @@ from unittest.mock import patch
from bot_bottle.sidecar_init import (
_DaemonSpec,
_Supervisor,
_argv_for_daemon,
_env_for_daemon,
_selected_daemons,
)
@@ -120,6 +121,28 @@ class TestSelectedDaemons(unittest.TestCase):
self.assertEqual([d.name for d in got], ["egress", "git-gate"])
class TestDaemonArgv(unittest.TestCase):
def test_git_daemons_wait_for_ready_marker_when_configured(self):
argv = _argv_for_daemon(
"git-gate",
("/bin/sh", "/git-gate-entrypoint.sh"),
{"BOT_BOTTLE_GIT_GATE_READY_FILE": "/run/git-gate/ready"},
)
self.assertEqual("/bin/sh", argv[0])
self.assertEqual("-c", argv[1])
self.assertIn("BOT_BOTTLE_GIT_GATE_READY_FILE", argv[2])
self.assertEqual("git-gate", argv[3])
self.assertEqual(["/bin/sh", "/git-gate-entrypoint.sh"], argv[4:])
def test_non_git_daemon_does_not_wait_for_ready_marker(self):
argv = _argv_for_daemon(
"egress",
("/bin/sh", "/app/egress-entrypoint.sh"),
{"BOT_BOTTLE_GIT_GATE_READY_FILE": "/run/git-gate/ready"},
)
self.assertEqual(["/bin/sh", "/app/egress-entrypoint.sh"], argv)
class TestSupervisor(unittest.TestCase):
"""End-to-end: drive `_Supervisor` directly with fake commands.
We don't go through `main()` because main installs signal