test(roles): run molecule's check step before and after converge #395
Open
Claude
wants to merge 3 commits from
test/134-check-before-after-converge into main
pull from: test/134-check-before-after-converge
merge into: Mortis:main
Mortis:main
Labels
Clear labels
Compat/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Breaking change that won't be backward compatible
Something is not working
Documentation changes
Improve existing functionality
New functionality
This is security issue
Issue or pull request related to testing
Priority
Critical
1
The priority is critical
Priority
High
2
The priority is high
Priority
Medium
3
The priority is medium
Priority
Low
4
The priority is low
Reviewed
Confirmed
1
Issue has been confirmed
Reviewed
Duplicate
2
This issue or pull request already exists
Reviewed
Invalid
3
Invalid issue
Reviewed
Won't Fix
3
This issue won't be fixed
Status
Blocked
1
Something is blocking this issue or pull request
Status
Need More Info
2
Feedback is required to reproduce issue or to continue work
Status
Abandoned
3
Somebody has started to work on this but abandoned work
Status
Needs Triage
Maintainer needs to evaluate this issue
Status
Ready for Agent
Fully specified, ready for an AFK agent
Status
Ready for Human
Requires human implementation
Wayfinder
Grilling
Decision ticket resolved in conversation with the maintainer
Wayfinder
Map
Wayfinder map: index of a planning effort and its decision tickets
Wayfinder
Prototype
Decision ticket resolved by reacting to a rough concrete artifact
Wayfinder
Research
Decision ticket resolved by reading outside sources
Wayfinder
Task
Manual work that must happen before a decision can be made
No labels
Milestone
No items
No Milestone
Continuous delivery
Projects
Clear projects
No projects
No Assignees
Defame1297
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: Mortis/Kamino#395
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
What and why
Closes #134
Every role scenario with a converge now runs
checkright before it (a fresh host) and right after it, beforeidempotence(a configured host). A new test intests/scripts/test_run_molecule_scenarios.pyfails any role scenario without both._binary_update/check_modeis check-only and unchanged. pihole and pve_lxc had their secondcheckafteridempotence; it now sits afterconverge, like every other scenario.Notes on the issue text:
destroy. The issue's sequence ends indestroy, but scenarios deliberately have none (.gitea/workflows/AGENTS.md), so none is added.checktwice in CI..gitea/workflows/AGENTS.md, and that is the line updated.Fixes for
--checkfailures on a fresh host. A task that would fail is now skipped only under--check, and only when an earlier task in the same run would have created what it needs:checkexercises these.authorized_keysof a user not created yet.Each has a
bugfixesfragment line.Scenario fixtures. The molecule images ship without apt lists, and apt does not refresh them under
--check. The docker and traefik scenarios'prepare.ymlnow refresh the apt cache, so the fresh-hostcheckfinds the packages the role installs. pihole and system_baseline already did this.Decided with the maintainer during review:
when: not ansible_check_mode or <condition>(the form pihole already uses), so--checkstill previews a configured host.roles/AGENTS.mdnow says so.--checkpreviews only a host where the package is installed, and their README Notes say so. Guarding a host without the package would need guards on most of their tasks. The ufw probe (#271) is untouched.Runtime. Two
checkruns are estimated to add about 35% to Molecule runner time. Last nightly full run: about 18 min; estimated after: about 23–24 min. This is estimated from task counts in nightly run 5710, not measured. Daytime runs of this PR cannot confirm it: run 5755, another PR's run this morning without this change, was as slow as this PR's (44 min, with system_baseline at 1542 s).Verified
python3 -m unittest discover -s tests/scripts: OK. The new test failed before the sequence change and passes after.pre-commit run --all-fileswith.venvon PATH: all hooks pass (ansible-lint, yamllint, REUSE, changelog lint, gitleaks).ansible-test sanityvia the pre-push hook: passed..venv),--checkruns against localhost confirmed:changedand do not fail;commandwithcreatesreportschanged(traefik's ACME guard relies on this);userwith a missing group fails for an existing user.3afff00): 14 of 16 role scenarios passed with the new sequence. docker and traefik failed in the firstcheckwith "No package matching 'curl'/'wget' is available"; the apt refresh in theirprepare.yml(9ce0fbd) fixes this.3afff00, or decided with the maintainer as above.9ce0fbd.Not verified
9ce0fbd. The run for the current head is pending. Whether docker and traefik now pass bothchecksteps, and so whether every role passes (the issue's acceptance criterion), is shown by that run.--checkon a fresh host;--checkon a host without ufw or fail2ban (documented as unsupported).NOTICEandREUSE.toml, or there is none.Assisted-by: Claude Code
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.