refactor: remove placeholder join step

This commit is contained in:
lda
2026-09-05 17:47:57 +07:00 Verified
parent 043bda6a34
commit cccdbc0a47
42 changed files with 88 additions and 309 deletions
+5 -34
View File
@@ -824,7 +824,6 @@ def test_wf_draft_add_help_lists_typed_step_commands_and_removes_flat_command()
"capability",
"interrupt",
"foreach",
"join",
"end",
"when",
"choose",
@@ -1531,7 +1530,7 @@ def test_wf_draft_add_foreach_builds_concurrent_policy(monkeypatch) -> None:
assert calls[1]["step"].foreach.concurrent.max_outstanding == 20
def test_wf_draft_add_join_and_end_build_concrete_steps(monkeypatch) -> None:
def test_wf_draft_add_end_builds_concrete_step(monkeypatch) -> None:
calls: list[dict[str, Any]] = []
class FakeHandlers:
@@ -1544,25 +1543,6 @@ def test_wf_draft_add_join_and_end_build_concrete_steps(monkeypatch) -> None:
"wf_cli.commands.draft_add.load_cli_context", lambda _ctx: context
)
join_result = runner.invoke(
app,
[
"draft",
"add",
"join",
"workspace",
"--revision",
"1",
"--step",
"joined",
"--from-step",
"each_issue",
"--from-outcome",
"done",
"--route",
"done=finish",
],
)
end_result = runner.invoke(
app,
[
@@ -1571,7 +1551,7 @@ def test_wf_draft_add_join_and_end_build_concrete_steps(monkeypatch) -> None:
"end",
"workspace",
"--revision",
"2",
"1",
"--step",
"finish",
"--outcome",
@@ -1579,12 +1559,9 @@ def test_wf_draft_add_join_and_end_build_concrete_steps(monkeypatch) -> None:
],
)
assert join_result.exit_code == 0, join_result.output
assert end_result.exit_code == 0, end_result.output
assert calls[0]["step"].model_dump(mode="json") == {"join": {}}
assert calls[0]["routes"] == {"done": "finish"}
assert calls[1]["step"].model_dump(mode="json") == {"end": {"outcome": "completed"}}
assert calls[1]["routes"] is None
assert calls[0]["step"].model_dump(mode="json") == {"end": {"outcome": "completed"}}
assert calls[0]["routes"] is None
def test_wf_draft_add_control_commands_reject_invalid_input_before_api_call(
@@ -1788,12 +1765,9 @@ def test_wf_draft_add_control_commands_reject_invalid_input_before_api_call(
def test_wf_draft_add_control_command_help_is_type_specific() -> None:
interrupt = runner.invoke(app, ["draft", "add", "interrupt", "--help"])
foreach = runner.invoke(app, ["draft", "add", "foreach", "--help"])
join = runner.invoke(app, ["draft", "add", "join", "--help"])
end = runner.invoke(app, ["draft", "add", "end", "--help"])
assert (
interrupt.exit_code == foreach.exit_code == join.exit_code == end.exit_code == 0
)
assert interrupt.exit_code == foreach.exit_code == end.exit_code == 0
assert "--request-schema-file" in interrupt.output
assert "--resume-schema-file" in interrupt.output
assert "--request" in interrupt.output
@@ -1806,9 +1780,6 @@ def test_wf_draft_add_control_command_help_is_type_specific() -> None:
assert "--item-error" in foreach.output
assert "--collect-to" in foreach.output
assert "--request-schema-file" not in foreach.output
assert "--from-step" in join.output
assert "--route" in join.output
assert "--request-schema-file" not in join.output
assert "--outcome" in end.output
assert "--route" not in end.output
+8 -21
View File
@@ -771,14 +771,14 @@ def test_wf_remote_capability_free_draft_lifecycle(monkeypatch, tmp_path) -> Non
[
"draft",
"add",
"join",
"end",
"control_ws",
"--revision",
"1",
"--step",
"gate",
"--route",
"done=finish",
"finish",
"--outcome",
"error",
],
[
"draft",
@@ -787,26 +787,14 @@ def test_wf_remote_capability_free_draft_lifecycle(monkeypatch, tmp_path) -> Non
"--revision",
"2",
"--step",
"gate",
],
[
"draft",
"add",
"end",
"control_ws",
"--revision",
"3",
"--step",
"finish",
"--outcome",
"error",
],
[
"draft",
"set-contract",
"control_ws",
"--revision",
"4",
"3",
"--outcome",
"error",
],
@@ -824,10 +812,10 @@ def test_wf_remote_capability_free_draft_lifecycle(monkeypatch, tmp_path) -> Non
assert '"status": "valid"' in results[-1].output
assert inspected.exit_code == 0, inspected.output
payload = json.loads(inspected.output)
assert payload["revision"] == 5
assert payload["draft"]["start"] == "gate"
assert payload["revision"] == 4
assert payload["draft"]["start"] == "finish"
assert payload["draft"]["outcomes"] == ["error"]
assert set(payload["draft"]["steps"]) == {"gate", "finish"}
assert set(payload["draft"]["steps"]) == {"finish"}
def test_wf_draft_export_uses_remote_get_and_writes_only_draft(
@@ -2409,7 +2397,6 @@ def test_wf_draft_add_control_steps_use_generic_rpc_target(
"completed_with_errors": "__end__",
},
),
("join", ["--route", "done=__end__"], {}, {"done": "__end__"}),
("end", ["--outcome", "ok"], {"outcome": "ok"}, None),
(
"when",
-1
View File
@@ -67,7 +67,6 @@ def test_schema_compact_alias_is_json_outline_without_refs() -> None:
"SubgraphNode",
"ConditionNode",
"ForeachNode",
"JoinNode",
"EndNode",
"InterruptNode",
]