test(ansible): the swarm prune guard's comment states why, not when (#6399)
CI / lint (push) Successful in 1s
CI / unit (push) Successful in 1m37s
CI / integration (push) Successful in 1m47s
CI / publish (push) Successful in 15s

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-25 11:30:00 -04:00
co-authored by Claude Opus 5.5
parent b2f4dde288
commit ae789bc0f1
+2 -2
View File
@@ -35,8 +35,8 @@ def test_the_playbook_is_listed_and_asks_before_it_runs():
script = next(t for t in play["tasks"] if "ansible.builtin.script" in t) script = next(t for t in play["tasks"] if "ansible.builtin.script" in t)
assert script["check_mode"] is False and "--dry-run" in script["ansible.builtin.script"]["cmd"] assert script["check_mode"] is False and "--dry-run" in script["ansible.builtin.script"]["cmd"]
# No docker prune touches images: an image swarm pulled by digest has no # No docker prune touches images: an image swarm pulled by digest has no
# tag, and Docker calls that dangling (on 2026-10-25 a `system prune` # tag, and Docker calls that dangling, so a `system prune` removes the
# took 29 a node was keeping for the other's services). # images a node keeps for the other node's services.
commands = yaml.safe_dump([t for t in play["tasks"] if "ansible.builtin.command" in t]) commands = yaml.safe_dump([t for t in play["tasks"] if "ansible.builtin.command" in t])
assert "'system'" not in commands and "'image'" not in commands assert "'system'" not in commands and "'image'" not in commands
assert "'container', 'prune'" in commands and "'builder', 'prune'" in commands assert "'container', 'prune'" in commands and "'builder', 'prune'" in commands