27 lines
833 B
Python
27 lines
833 B
Python
from __future__ import annotations
|
|
|
|
from pathlib import Path
|
|
|
|
from engine.devops_agent.compiler import compile_workflow
|
|
from engine.devops_agent.spec import load_workflow_spec
|
|
|
|
|
|
def test_compile_emits_normalized_lock_payload() -> None:
|
|
spec = load_workflow_spec(Path("workflows/gitea-issue-delivery.md"))
|
|
|
|
lock = compile_workflow(spec)
|
|
|
|
assert lock["version"] == 1
|
|
assert lock["workflow_name"] == "gitea-issue-delivery"
|
|
assert lock["provider"] == "gitea"
|
|
assert lock["triggers"] == [
|
|
{
|
|
"event": "issue_comment",
|
|
"commands": ["@devops-agent"],
|
|
}
|
|
]
|
|
assert lock["policy"]["path_scope"] == []
|
|
assert lock["policy"]["require_human_merge"] is True
|
|
assert lock["safe_outputs"]["add_comment"]["max"] == 3
|
|
assert "issue_comment" in lock["required_evidence"]
|