Answer stability round 1: 0 🔴, 2 🟡 (0 misread); keep a finished chunk open until a person's merge is read and its worktree removed, and assert facts in place of sentences

This commit is contained in:
Lilleman
2026-11-19 18:07:54 +01:00
parent 2e0ceef6ae
commit 24bd382d48
7 changed files with 77 additions and 27 deletions
+8 -4
View File
@@ -372,14 +372,18 @@ class Merge(unittest.TestCase):
with self.subTest(origin):
checkout = self.merged_by_a_human(origin)
done = step(["merge"], checkout, checkout.config)
self.assertEqual(done, "Marked pull request #12 ready. It passed its checks and awaits a person's merge, since the project's config sets `merge = \"human\"`: leave the merge to them, and report the chunk as ready to merge. Once it is merged, run chunk-pr clean in this worktree.")
for fact in ("pull request #12", "awaits a person's merge", "chunk-pr clean"):
self.assertIn(fact, str(done))
self.assertNotIn("end your run", str(done))
self.assertEqual(checkout.acted()[-1], ready)
self.assertFalse(any("merge" in command[1:4] for command in checkout.acted() if command[0] != "git"), checkout.acted())
def test_under_a_humans_merge_a_chunk_that_parks_is_told_to_end_its_run(self):
checkout = self.merged_by_a_human()
done = merged(checkout, checkout.config, self.fail, parks=True)
self.assertEqual(done, "Marked pull request #12 ready. It passed its checks and awaits a person's merge, since the project's config sets `merge = \"human\"`: end your run now, since do-epic parks the chunk and resumes this session once it is merged or a reviewer comments.")
for fact in ("pull request #12", "awaits a person's merge", "end your run"):
self.assertIn(fact, str(done))
self.assertNotIn("chunk-pr clean", str(done))
def test_under_a_humans_merge_a_failed_check_leaves_the_pull_request_as_it_was(self):
checkout = self.merged_by_a_human()
@@ -397,8 +401,8 @@ class Merge(unittest.TestCase):
self.assertNotIn(GH_DECISION, checkout.ran)
def test_merge_waits_for_no_approval_where_a_person_merges_and_for_the_configs_otherwise(self):
self.assertEqual([awaited("gh", True, True), awaited("tea", True, True), awaited("gh", True), awaited("gh", False)], [False, False, True, False])
self.assertIsInstance(awaited("tea", True), Failure)
self.assertEqual([awaited("gh", True, True), awaited("tea", True, True), awaited("gh", True, False), awaited("gh", False, False)], [False, False, True, False])
self.assertIsInstance(awaited("tea", True, False), Failure)
def test_under_a_humans_merge_a_pull_request_that_cannot_be_marked_ready_fails_saying_why(self):
checkout = self.merged_by_a_human()