test(roles): run molecule's check step before and after converge #134

Open
opened 2026-11-14 21:50:50 +00:00 by Claude · 5 comments
Owner

Spec: Role standard, resolution comment, "Check mode".

What

  • In every role scenario's scenario.test_sequence, add check before converge and again after it: dependency, cleanup, syntax, create, prepare, check, converge, check, idempotence, side_effect, verify, cleanup, destroy.
  • The check_mode scenario of _binary_update (roles/_binary_update/molecule/check_mode) is already check-only, has no converge step, and is left as it is.
  • First confirm that molecule accepts a step listed twice. If it does not, add only the before-converge check and record that in the PR.
  • Fix the check-mode failures this exposes. The only allowed guards are check_mode: false on read-only probes and when: not ansible_check_mode.
  • A role that cannot support check mode explains why in its README's Notes and leaves the step out.
  • Update the line in AGENTS.md on the sequence that new scenarios copy. The root AGENTS.md replaces CLAUDE.md before this lands (#185 blocks this issue).

Acceptance

Molecule passes for every role with the new sequence.

Spec: [Role standard](https://git.rkdr.net/Mortis/Kamino/issues/93), resolution comment, "Check mode". ## What - In every role scenario's `scenario.test_sequence`, add `check` before `converge` and again after it: dependency, cleanup, syntax, create, prepare, check, converge, check, idempotence, side_effect, verify, cleanup, destroy. - The `check_mode` scenario of `_binary_update` (`roles/_binary_update/molecule/check_mode`) is already check-only, has no `converge` step, and is left as it is. - First confirm that molecule accepts a step listed twice. If it does not, add only the before-converge `check` and record that in the PR. - Fix the check-mode failures this exposes. The only allowed guards are `check_mode: false` on read-only probes and `when: not ansible_check_mode`. - A role that cannot support check mode explains why in its README's Notes and leaves the step out. - Update the line in `AGENTS.md` on the sequence that new scenarios copy. The root `AGENTS.md` replaces `CLAUDE.md` before this lands ([#185](https://git.rkdr.net/Mortis/Kamino/issues/185) blocks this issue). ## Acceptance Molecule passes for every role with the new sequence.
Claude added the
Status
Ready for Agent
label 2026-11-14 21:50:50 +00:00
Claude added a new dependency 2026-11-15 22:20:53 +00:00
Claude added a new dependency 2026-11-15 22:20:53 +00:00
Claude added this to the Continuous delivery milestone 2026-11-15 22:21:20 +00:00
Author
Owner

Order: this now waits on docs(agents): replace CLAUDE.md with a root AGENTS.md (#185): put the CLAUDE.md edits in the root or nested AGENTS.md instead. (From Order of the implementation backlog, #198.)

Order: this now waits on docs(agents): replace CLAUDE.md with a root AGENTS.md (#185): put the `CLAUDE.md` edits in the root or nested `AGENTS.md` instead. (From Order of the implementation backlog, #198.)
Author
Owner

Review of the map (2026-11-15): corrections to this issue.

  • ufw already detects check mode in a way the allowed-guard list does not include. The issue allows only check_mode: false on read-only probes and when: not ansible_check_mode. roles/ufw/README.md:57 says the role detects check mode "with a skipped probe task, not ansible_check_mode", and its service_rules and orphan_rules entry points depend on that. As written, an implementer would add guards on top of the probe or rewrite it. Change: add "ufw detects check mode with a probe task: either keep it and record it as a third allowed guard (in this issue's PR and in the role rules), or replace it with ansible_check_mode as its own change. Do not stack both."
Review of the map (2026-11-15): corrections to this issue. - **`ufw` already detects check mode in a way the allowed-guard list does not include.** The issue allows only `check_mode: false` on read-only probes and `when: not ansible_check_mode`. `roles/ufw/README.md:57` says the role detects check mode "with a skipped probe task, not `ansible_check_mode`", and its `service_rules` and `orphan_rules` entry points depend on that. As written, an implementer would add guards on top of the probe or rewrite it. Change: add "`ufw` detects check mode with a probe task: either keep it and record it as a third allowed guard (in this issue's PR and in the role rules), or replace it with `ansible_check_mode` as its own change. Do not stack both."
Author
Owner

Review of the map (2026-11-17).

Review of the map (2026-11-17). - After the molecule fixtures issue, the `check` before converge runs on an image without the packages the role installs. Not tested. If a role then needs guards on most of its tasks, say so on this issue before adding them. - The either-or about the `ufw` probe in the comment of 2026-11-16 leaves a rule's content to the implementer. It is question 5 of [Role interface and semver: output facts, handler names, dropped platforms and internal roles](https://git.rkdr.net/Mortis/Kamino/issues/257). The same ticket's question 6 answers the `warn_list` either-or on [ci(lint): enable and gate ansible-lint's complexity rule](https://git.rkdr.net/Mortis/Kamino/issues/138).
Author
Owner

Decided by Role interface and semver: output facts, handler names, dropped platforms and internal roles (2026-11-20)

  • The ufw either-or is settled: the allowed guards stay exactly two (check_mode: false on read-only probes, when: not ansible_check_mode), and --check is the supported preview. The ufw probe is replaced in refactor(roles): detect check mode only with ansible_check_mode. This issue does not touch the probe and adds no guard on top of it.
  • Molecule's check step runs ansible-playbook --check, where both guards work.
## Decided by [Role interface and semver: output facts, handler names, dropped platforms and internal roles](https://git.rkdr.net/Mortis/Kamino/issues/257) (2026-11-20) - The `ufw` either-or is settled: the allowed guards stay exactly two (`check_mode: false` on read-only probes, `when: not ansible_check_mode`), and `--check` is the supported preview. The ufw probe is replaced in [refactor(roles): detect check mode only with ansible_check_mode](https://git.rkdr.net/Mortis/Kamino/issues/271). This issue does not touch the probe and adds no guard on top of it. - Molecule's `check` step runs `ansible-playbook --check`, where both guards work.
Author
Owner

Final validation round, second pass (2026-11-20): body edited.

  • The CLAUDE.md line is now an AGENTS.md line, noting that #185 blocks this issue (comment of 2026-11-15 folded in).
  • Added: the check_mode scenario of _binary_update is already check-only, has no converge step, and is left as it is.

The comments above stay as history.

Final validation round, second pass (2026-11-20): body edited. - The `CLAUDE.md` line is now an `AGENTS.md` line, noting that [#185](https://git.rkdr.net/Mortis/Kamino/issues/185) blocks this issue (comment of 2026-11-15 folded in). - Added: the `check_mode` scenario of `_binary_update` is already check-only, has no `converge` step, and is left as it is. The comments above stay as history.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Reference: Mortis/Kamino#134