Merge branch 'reach-pick-line'

This commit is contained in:
swaits committed 2026-12-03 20:45:57 -07:00
commit 8484be7383
2 files changed
+15

No files matched your search

+1
View File
@@ -431,6 +431,7 @@ def pick(args, cwd=None, rand=None):
clock(g[0]), g[1][:160] + ("…" if len(g[1]) > 160 else "")))
from . import plan
print(plan.record_line())
node or print(plan.REACH_LINE)
also and print("this worker already runs node %s: judge with --node %s" % (", ".join(also), node))
if node and sid:
with store.session(sid) as s: print(plan.header(s["plan"], node))
+14
View File
@@ -156,6 +156,20 @@ class Plan(unittest.TestCase):
self.assertIn("reach: make this 100x faster", out)
self.assertIn(plan.REACH_LINE, out)
def test_pick_without_a_node_prints_the_reach_line_but_no_reach(self):
from sisi import plan
self.table(TABLE)
rc, out, _ = self.sisi("pick", "routine")
self.assertEqual(rc, 0, out)
self.assertIn(plan.REACH_LINE, out)
self.assertEqual([l for l in out.splitlines() if l.startswith("reach:")], [], out)
self.ready_plan(text=REACH + (
"| a | routine | - | p-a | sisi/a.py | test a passes | make this 100x faster | exact spec |\n"
"| b | ordinary | - | p-b | sisi/b.py | test b passes | | some judgement |\n"
"| join | lead | a, b | - | - | full suite passes | | the lead merges |\n"))
out = self.pick("a")
self.assertEqual(out.count(plan.REACH_LINE), 1, out)
def test_record_line_counts_the_last_twenty_judged_per_class(self):
self.table(TABLE)
line = lambda w, v: json.dumps({"ts": "2026-11-20T10:00:00", "worker": w, "verdict": v, "why": "did it fine"})