Print each chunk that asks a question and since when each parked chunk awaits its gate in do-epic --status
CI / tests (pull_request) Failing after 3m23s

This commit is contained in:
2026-11-19 00:40:16 +01:00
parent a49479948a
commit 8e210eaa09
8 changed files with 104 additions and 31 deletions
+13 -4
View File
@@ -1,7 +1,9 @@
import contextlib
import dataclasses
import datetime
import io
import json
import os
import pathlib
import shutil
import subprocess
@@ -41,6 +43,11 @@ class Description:
return self.text
# When the parked chunks of the status test were parked, and how the status prints it, in the machine's time zone.
PARKED_SINCE = 1_700_000_000
PARKED_ON = datetime.datetime.fromtimestamp(PARKED_SINCE).strftime("%Y-%m-%d %H:%M")
class DoEpicTest(unittest.TestCase):
def setUp(self) -> None:
made = tempfile.TemporaryDirectory()
@@ -614,17 +621,19 @@ class TheStatus(DoEpicTest):
parked.park(folder, parked.Parked("ABC-26", "/code/api-ABC-26", "9", "s", "its checks"))
parked.park(folder, parked.Parked("ABC-28", "/code/api-ABC-28", "11", "s", "an approval"))
self.issues.insert(7, issue("ABC-28", "repo:api"))
for issue_key, when in (("ABC-20", PARKED_SINCE), ("ABC-26", PARKED_SINCE), ("ABC-28", PARKED_SINCE)):
os.utime(parked.file_of(folder, issue_key), (when, when))
fake = FakeEffects(windows="ABC-20 awaits an approval\t0\t@1\nABC-21 ?\t0\t@2\nABC-22\t1\t@3\nABC-28 awaits a slot\t0\t@4\n")
code, out, err = self.run_main(["ABC-12", "--status"], fake)
self.assertEqual((code, err), (0, ""))
self.assertEqual(out.replace("<1790000000> ", "").splitlines(), [
"ABC-20 waits: it is parked: its pull request #7 awaits an approval",
"ABC-21 runs",
f"ABC-20 waits: it is parked: its pull request #7 awaits an approval, since {PARKED_ON}",
"ABC-21 asks you: answer its question in the tmux window epic-ABC-12:ABC-21",
"ABC-22 waits: its window stopped; run `do-epic ABC-12` to start it again",
"ABC-23 waits: ABC-20 blocks it",
"ABC-24 waits: it has not started; `do-epic ABC-12` starts it once the epic and its repo have room",
"ABC-26 waits: it is parked: its pull request #9 awaits its checks, and its window stopped; run `do-epic ABC-12` to start it again",
"ABC-28 waits: it is parked: its worker has work again on pull request #11 and awaits a slot",
f"ABC-26 waits: it is parked: its pull request #9 awaits its checks, since {PARKED_ON}, and its window stopped; run `do-epic ABC-12` to start it again",
f"ABC-28 waits: it is parked: its worker has work again on pull request #11 and awaits a slot, since {PARKED_ON}",
"ABC-27 waits: no label names its repo",
])
self.assertEqual({args[0] for args in fake.tmux_calls}, {"-V", "list-windows"})