ci(molecule): run Molecule from the ci image instead of the runner's venv
Pin molecule and its Docker driver in requirements-dev.txt and bake them, with the driver's collection, into the ci image. The Molecule job runs docker run on the pinned ci image with the Docker socket and the checkout mounted at the same path, as the runner user. A pull request whose pins differ from the image installs its own pins first, so a core bump runs its scenarios on the new core. gitea_runner no longer installs the molecule venv and collections. Closes #225 Assisted-by: Claude Code
This commit is contained in:
1 parent
d9be7b7dc8
commit
2e32016c43
25 files changed
+292
-275
No files matched your search
@@ -511,6 +511,12 @@ class PureTest(unittest.TestCase):
|
||||
)
|
||||
self.assertEqual(civ.dockerfile_labels('FROM c\nLABEL a="unbalanced\n'), {})
|
||||
|
||||
def test_the_molecule_collections_are_an_input_of_the_ci_image(self):
|
||||
root = pathlib.Path(__file__).resolve().parents[2]
|
||||
entry = civ.matrix_of((root / civ.MATRIX_FILE).read_text())["ci"]
|
||||
_, files = civ.inputs_of(entry, (root / entry["dockerfile"]).read_text())
|
||||
self.assertIn("extensions/molecule/requirements.yml", files)
|
||||
|
||||
def test_real_dockerfiles_carry_the_metadata(self):
|
||||
root = pathlib.Path(__file__).resolve().parents[2]
|
||||
matrix = civ.matrix_of((root / civ.MATRIX_FILE).read_text())
|
||||
|
||||
Reference in new issue
Block a user