Test that a parked chunk says once what it awaits, and stops where its new gate cannot be recorded
CI / tests (pull_request) Failing after 5m55s
CI / tests (pull_request) Failing after 5m55s
This commit is contained in:
@@ -676,6 +676,7 @@ class AChunkWhosePullRequestWaitsOnAGate(DoEpicTest):
|
||||
self.assertEqual(states, [(60, {"ABC-20": parked.Parked("ABC-20", "/code/api-ABC-20", "7", str(self.session.id), "an approval")})] * 2)
|
||||
self.assertFalse(self.file.exists())
|
||||
self.assertIn("parked: pull request #7 awaits an approval\nstarted ABC-22\n", out)
|
||||
self.assertEqual(out.count("parked: "), 1)
|
||||
self.assertEqual(len(prompts), 2)
|
||||
self.assertTrue(prompts[0].startswith("Work the Jira issue ABC-20 "), prompts[0])
|
||||
self.assertEqual(set(self.forges[0].ran[:1] + self.forges[1].ran[:1]), {checkout})
|
||||
@@ -708,6 +709,16 @@ class AChunkWhosePullRequestWaitsOnAGate(DoEpicTest):
|
||||
self.assertIn('`merge` is \'nobody\', not "chunk" or "human"', err)
|
||||
self.assertNotIn("parked: ", out)
|
||||
|
||||
def test_stops_where_the_gate_a_parked_chunk_moved_to_cannot_be_recorded(self) -> None:
|
||||
self.repo_config.write_text(self.repo_config.read_text(encoding="utf-8") + 'merge = "human"\n', encoding="utf-8")
|
||||
self.forges = [awaiting(), awaiting(decision="APPROVED")]
|
||||
fake = FakeEffects(streams=[self.worker()], claude=[judged("unfinished")], git=UNREAD, windows=PARKED_WINDOW)
|
||||
fake.effects = lambda made=fake.effects(): dataclasses.replace(made, sleep=lambda seconds: self.file.parent.chmod(0o555)) # type: ignore[method-assign]
|
||||
self.addCleanup(lambda: self.file.parent.chmod(0o755))
|
||||
code, out, err, prompts = self.parked_run(fake)
|
||||
self.assertEqual((code, len(prompts), out.count("parked: ")), (1, 1, 1))
|
||||
self.assertIn("Permission denied", err)
|
||||
|
||||
def test_where_the_chunk_merges_an_approved_pull_request_parks_no_chunk(self) -> None:
|
||||
self.forges = [awaiting(decision="APPROVED")]
|
||||
fake = FakeEffects(streams=[self.worker()], claude=[judged("finished")], git=UNREAD, windows=PARKED_WINDOW)
|
||||
|
||||
Reference in New Issue
Block a user