fix(roles): refresh apt in the docker and traefik scenarios and apply review round 2
The molecule images ship without apt lists, and --check does not refresh them, so the fresh-host check of docker and traefik could not find curl and wget. Their prepare now refreshes the cache, as pihole's and system_baseline's already do by installing fixtures. The sequence test gets its own class after the platform tests, the check-mode rule is split into guards and README, and the user_management comment sits on the task it explains. Assisted-by: Claude Code
This commit is contained in:
1 parent
3afff00b9b
commit
9ce0fbd433
5 files changed
+42
-30
No files matched your search
@@ -395,25 +395,6 @@ class ScenarioPlatformsTest(unittest.TestCase):
|
||||
seen[name] = where
|
||||
self.assertNotIn("destroy", data["scenario"]["test_sequence"], path)
|
||||
|
||||
|
||||
class ScenarioSequenceTest(unittest.TestCase):
|
||||
"""A role scenario previews the fresh host and the configured host with molecule's check step."""
|
||||
|
||||
def test_role_scenarios_run_check_before_and_after_converge(self):
|
||||
# A check-only scenario has no converge to surround, so it is not held to this.
|
||||
files = sorted(REPO.glob("roles/*/molecule/*/molecule.yml"))
|
||||
self.assertTrue(files)
|
||||
for path in files:
|
||||
sequence = yaml.safe_load(path.read_text())["scenario"]["test_sequence"]
|
||||
if "converge" not in sequence:
|
||||
continue
|
||||
at = sequence.index("converge")
|
||||
self.assertEqual(
|
||||
sequence[at - 1 : at + 3],
|
||||
["check", "converge", "check", "idempotence"],
|
||||
path.relative_to(REPO),
|
||||
)
|
||||
|
||||
def test_the_workflow_finds_the_containers_by_the_run_label(self):
|
||||
# the sweep of earlier runs filters by the key, the cleanup of this run by key and value
|
||||
self.assertEqual(
|
||||
@@ -435,5 +416,24 @@ class ScenarioSequenceTest(unittest.TestCase):
|
||||
)
|
||||
|
||||
|
||||
class ScenarioSequenceTest(unittest.TestCase):
|
||||
"""A role scenario previews the fresh host and the configured host with molecule's check step."""
|
||||
|
||||
def test_role_scenarios_run_check_before_and_after_converge(self):
|
||||
# A check-only scenario has no converge to surround, so it is not held to this.
|
||||
files = sorted(REPO.glob("roles/*/molecule/*/molecule.yml"))
|
||||
self.assertTrue(files)
|
||||
for path in files:
|
||||
sequence = yaml.safe_load(path.read_text())["scenario"]["test_sequence"]
|
||||
if "converge" not in sequence:
|
||||
continue
|
||||
at = sequence.index("converge")
|
||||
self.assertEqual(
|
||||
sequence[at - 1 : at + 3],
|
||||
["check", "converge", "check", "idempotence"],
|
||||
path.relative_to(REPO),
|
||||
)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
Reference in new issue
Block a user