diff --git a/config/schema.json b/config/schema.json index cac0631..ba0250f 100644 --- a/config/schema.json +++ b/config/schema.json @@ -53,7 +53,7 @@ "repo": {"type": "string"}, "plane_user": {"type": "string"}, "token_key": {"type": "string"}, - "concurrency": {"type": "integer", "minimum": 1}, + "concurrency": {"type": "integer", "minimum": 0}, "capabilities": {"$ref": "#/definitions/strings"}, "executors": {"type": "array", "items": {"type": "string"}, "minItems": 1}, "bins": {"type": "object", "additionalProperties": {"type": "string"}}, diff --git a/tests/test_config.py b/tests/test_config.py index 9c15cc6..b3d00a9 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -45,6 +45,12 @@ class ConfigTest(unittest.TestCase): d["terminals"]["oregon"]["concurrency"] = "two" self.check_both(d, "concurrency") + def test_concurrency_zero_is_valid(self): # 0 = terminal paused (nothing new is dispatched) + d = config_data() + d["terminals"]["win10"]["concurrency"] = 0 + self.assertEqual(config.validate(d), []) + self.assertEqual(config.mini_validate(d, SCHEMA), []) + def test_semantic_routing_to_unknown_terminal(self): d = config_data() d["projects"]["GWENT"]["routing"]["by_assignee"]["mac"] = "mac" diff --git a/tests/test_core.py b/tests/test_core.py index 74c3760..afd285d 100644 --- a/tests/test_core.py +++ b/tests/test_core.py @@ -160,6 +160,14 @@ class CoreTest(unittest.TestCase): self.assertEqual(started, ["GW-1-1", "GW-3-1"]) # 2 slots; GW-2 waits for the game group self.assertEqual([self.p.state_of(x) for x in (a, b, c, d)], ["In Progress", "Todo", "In Progress", "Todo"]) + def test_concurrency_zero_pauses_terminal(self): + self.h.cfg.terminals["win10"]["concurrency"] = 0 + w = self.p.add_issue(1) + o = self.p.add_issue(2, assignee="oregon") + self.h.tick() + self.assertNotIn(("win10", "codex"), self.h.execs) # not even probed (busy_processes) + self.assertEqual((self.p.state_of(w), self.p.state_of(o)), ("Todo", "In Progress")) + def test_label_routing(self): self.p.add_issue(1, labels=["model:astra"]) self.p.add_issue(2, assignee="oregon", labels=["cap:gpu"]) # oregon lacks the capability