pick: the chore form prints the reach line too
This commit is contained in:
1 parent
68e8acb544
commit
1058be2f0e
2 files changed
+15
No files matched your search
@@ -431,6 +431,7 @@ def pick(args, cwd=None, rand=None):
|
|||||||
clock(g[0]), g[1][:160] + ("…" if len(g[1]) > 160 else "")))
|
clock(g[0]), g[1][:160] + ("…" if len(g[1]) > 160 else "")))
|
||||||
from . import plan
|
from . import plan
|
||||||
print(plan.record_line())
|
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))
|
also and print("this worker already runs node %s: judge with --node %s" % (", ".join(also), node))
|
||||||
if node and sid:
|
if node and sid:
|
||||||
with store.session(sid) as s: print(plan.header(s["plan"], node))
|
with store.session(sid) as s: print(plan.header(s["plan"], node))
|
||||||
|
|||||||
@@ -156,6 +156,20 @@ class Plan(unittest.TestCase):
|
|||||||
self.assertIn("reach: make this 100x faster", out)
|
self.assertIn("reach: make this 100x faster", out)
|
||||||
self.assertIn(plan.REACH_LINE, 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):
|
def test_record_line_counts_the_last_twenty_judged_per_class(self):
|
||||||
self.table(TABLE)
|
self.table(TABLE)
|
||||||
line = lambda w, v: json.dumps({"ts": "2026-11-20T10:00:00", "worker": w, "verdict": v, "why": "did it fine"})
|
line = lambda w, v: json.dumps({"ts": "2026-11-20T10:00:00", "worker": w, "verdict": v, "why": "did it fine"})
|
||||||
|
|||||||
Reference in new issue
Block a user