generated from coulomb/repo-seed
Add profile-driven lifecycle rules
This commit is contained in:
@@ -47,6 +47,29 @@ def test_cli_graph_lifecycle_emits_dry_run_actions(capsys) -> None:
|
||||
assert [action["action"] for action in output["data"]["dry_run_actions"]][:2] == ["mark_stale", "refresh"]
|
||||
|
||||
|
||||
def test_cli_graph_lifecycle_can_use_profile_rules(capsys) -> None:
|
||||
code = main(
|
||||
[
|
||||
"graph",
|
||||
"lifecycle",
|
||||
str(FIXTURES / "memory-graph.json"),
|
||||
"--profile",
|
||||
str(FIXTURES / "memory-profile.json"),
|
||||
"--refresh-digest",
|
||||
"event.restart=new",
|
||||
]
|
||||
)
|
||||
|
||||
output = json.loads(capsys.readouterr().out)
|
||||
actions = {(action["target_id"], action["action"]) for action in output["data"]["dry_run_actions"]}
|
||||
assert code == 0
|
||||
assert output["operation"] == "graph.lifecycle.plan"
|
||||
assert output["data"]["profile_id"] == "phase-memory-fixture-profile"
|
||||
assert output["data"]["rule_config"]["retention_default"]["stale_after_days"] == 7
|
||||
assert ("event.restart", "mark_stale") in actions
|
||||
assert ("event.restart", "refresh") in actions
|
||||
|
||||
|
||||
def test_cli_graph_activate_emits_selection(capsys) -> None:
|
||||
code = main(
|
||||
[
|
||||
|
||||
Reference in New Issue
Block a user