Test the human's task under the automation switch, a repeated failed read and the list of statuses in the wait line
CI / tests (pull_request) Successful in 2m55s

This commit is contained in:
Lilleman
2026-11-19 23:05:10 +01:00
parent f9959d25c5
commit daee3c671f
2 changed files with 21 additions and 8 deletions
+15 -2
View File
@@ -11,6 +11,7 @@ from do_epic.test_main import DESCRIPTION, Description, DoEpicTest, MODELS, UNRE
from do_epic.epic_record import EpicRecord
from failure import Failure
from loop_effects.doubles import FakeEffects
from do_epic.human_tasks import holds_up
from do_epic.scheduler import HUMAN_WAIT
from do_epic.test_scheduler import issue
from do_epic.backend.fake import MemoryEpic
@@ -49,9 +50,10 @@ class AHumanTaskThatBlocksAnIssue(DoEpicTest):
self.slept = slept
return self.run_main(["--chunk", "ABC-19", "ABC-12"], fake, MODELS)
def test_a_task_the_human_moves_to_an_unblocking_status_no_longer_holds_up_an_issue(self) -> None:
def moved_to_an_unblocking_status(self, switch: str) -> bool:
"""Whether Jira counts the task done after its window's run, where the human moved it to an unblocking status and the config ends with switch."""
with (self.home / ".claude-projects" / "do-epic" / "config.toml").open("a") as config:
config.write('jira-unblocking-statuses = ["Release Ready"]\n')
config.write('jira-unblocking-statuses = ["Release Ready"]\n' + switch)
fake = FakeEffects(git=UNREAD, windows=WINDOW)
slept: list[int] = []
@@ -64,6 +66,17 @@ class AHumanTaskThatBlocksAnIssue(DoEpicTest):
code, out, err = self.run_main(["--chunk", "ABC-19", "ABC-12"], fake, MODELS)
self.assertEqual((code, err, slept), (0, "", [60, 60]))
self.assertIn("the chunk finished; started ABC-21\n", out)
return next(each.done for each in self.epic.issues if each.key == "ABC-19")
def test_a_task_the_human_moves_to_an_unblocking_status_no_longer_holds_up_an_issue_and_moves_to_done(self) -> None:
self.assertTrue(self.moved_to_an_unblocking_status(""))
def test_where_the_teams_automation_moves_issues_the_humans_task_stays_where_the_human_moved_it(self) -> None:
self.assertFalse(self.moved_to_an_unblocking_status("jira-automation-moves-issues = true\n"))
def test_a_task_holds_up_only_the_issues_no_unblocking_status_settles(self) -> None:
issues = [issue("ABC-19", "do-epic-human"), issue("ABC-20", "do-epic-claude", blockers=("ABC-19",), status="Release Ready"), issue("ABC-21", "do-epic-claude", blockers=("ABC-19",))]
self.assertEqual(holds_up("ABC-19", issues, {}, ("Release Ready",)), ["ABC-21"])
def test_dms_the_human_once_parks_its_window_and_polls_until_the_issue_closes_then_starts_the_next(self) -> None:
fake = FakeEffects(git=UNREAD, windows=WINDOW)