test(supervise): stub the client in cmd_supervise crash-logging tests
test / unit (pull_request) Successful in 1m23s
test / integration (pull_request) Successful in 38s
test / coverage (pull_request) Successful in 1m42s
lint / lint (push) Successful in 2m15s
test / unit (push) Successful in 1m17s
test / integration (push) Successful in 31s
test / coverage (push) Successful in 1m31s
Update Quality Badges / update-badges (push) Successful in 1m35s

`cmd_supervise` establishes the orchestrator client up front (since the
HTTP-bridge move in 27fe03b), so these tests — which mock `curses.wrapper`
to exercise the KeyboardInterrupt / Die / crash-log paths — only reached
those paths when a live orchestrator happened to be reachable. On CI
(none reachable) the up-front connect errored and `cmd_supervise`
returned 1 before curses, failing all four. They passed locally only
because a dev orchestrator was up.

Stub `supervise_cli._client` in the class setUp so the tests isolate the
post-connect behavior they actually cover, independent of environment.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UoEZHDjv84ChoZbozQERhJ
This commit was merged in pull request #354.
This commit is contained in:
2026-07-16 22:44:47 -04:00
parent c15eed4f2e
commit 943049733e
@@ -56,6 +56,15 @@ class _FakeHomeMixin:
class TestCmdSuperviseErrorPaths(_FakeHomeMixin, unittest.TestCase):
def setUp(self):
self._setup_fake_home()
# `cmd_supervise` establishes the orchestrator client up front; these
# tests exercise the curses / crash-logging paths that run *after*
# that, so stub the client. Otherwise the outcome depends on whether a
# live orchestrator happens to be reachable (CI has none, so the
# up-front connect would error and short-circuit before curses).
client_patch = mock.patch.object(
supervise_cli, "_client", return_value=mock.MagicMock())
client_patch.start()
self.addCleanup(client_patch.stop)
def tearDown(self):
self._teardown_fake_home()