ci(molecule): run Molecule in the molecule-controller image

Molecule ran in the ci image, so a ci pin bump for a tool only Lint uses selected every
scenario (ADR 0003). The workflow now pins molecule-controller 0.1.0 by digest as
CONTROLLER_IMAGE, the hand-made first pin the ADR calls for.

- The run script checks /opt/molecule-pins.sha256 and installs requirements-molecule.lock
  when a pull request changed a pin file.
- The selector reads CONTROLLER_IMAGE: a controller pin change selects every scenario; a ci
  pin bump touches only lint.yml and build.yml, which are on IGNORED, so it selects none.
- Tests show requirements-molecule.* selects every scenario and requirements-dev.* none.
- Renovate's molecule.yml regex matches CONTROLLER_IMAGE.

Closes #434

Assisted-by: Claude Code
This commit is contained in:
Defame1297 committed 2026-11-29 19:25:33 +00:00
1 parent 6e89e4d857
commit 89bd579e87
7 files changed
+58 -32

No files matched your search

@@ -1,6 +1,7 @@
# SPDX-FileCopyrightText: Defame1297 and contributors
# SPDX-License-Identifier: GPL-3.0-or-later
"""Tests for scripts/run_molecule_in_ci_image.sh with stub tools in place of the ci image's.
"""Tests for scripts/run_molecule_in_ci_image.sh with stub tools in place of the molecule-controller
image's.
Run with: python3 -m unittest discover -s tests/scripts
"""
@@ -105,7 +106,7 @@ class RunMoleculeInCiImageTest(unittest.TestCase):
result = self.run_script()
self.assertEqual(result.returncode, 0, result.stderr)
(check,) = self.calls("sha256sum")
self.assertIn("args=--quiet -c /opt/ci-pins.sha256 ", check)
self.assertIn("args=--quiet -c /opt/molecule-pins.sha256 ", check)
self.assertEqual(self.calls("python"), [])
self.assertEqual(self.calls("ansible-galaxy"), [])
self.assertEqual(len(self.calls("ansible")), 1)
@@ -132,8 +133,8 @@ class RunMoleculeInCiImageTest(unittest.TestCase):
)
(pip,) = self.calls("pip")
self.assertIn(
"args=install --quiet --require-hashes -r requirements-dev.lock"
" -r requirements-dev.txt ",
"args=install --quiet --require-hashes -r requirements-molecule.lock"
" -r requirements-molecule.txt ",
pip,
)
galaxy = self.calls("ansible-galaxy")