mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2026-11-08 11:46:35 +00:00
test(env): check each distro's parent image against its own reference
The loop test only required three different parent images for three distros, which a swap between two of them would still pass. Each iteration now also records the owner and tag it sees, and its image must equal pkgmgr_image(distro, owner, tag). With the loader of main the test fails on arch with pkgmgr-debian:stable. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
1d970fe5bd
commit
ee8d2bd983
1 file changed
+7
-4
@@ -20,6 +20,7 @@ import unittest
|
||||
from pathlib import Path
|
||||
|
||||
from utils.cache.files import PROJECT_ROOT, read_text
|
||||
from utils.distros import pkgmgr_image
|
||||
from utils.env.parser import parse_static_env
|
||||
|
||||
LOOP = PROJECT_ROOT / "scripts" / "tests" / "deploy" / "distros.sh"
|
||||
@@ -79,13 +80,15 @@ class TestDistrosLoop(unittest.TestCase):
|
||||
def test_every_distro_runs_with_a_parent_image_of_its_own(self) -> None:
|
||||
proc, record = self._run(
|
||||
DISTROS,
|
||||
'echo "${INFINITO_DISTRO} ${INFINITO_PARENT_IMAGE}" >> "${RECORD}"',
|
||||
'echo "${INFINITO_DISTRO} ${INFINITO_PARENT_IMAGE}'
|
||||
' ${INFINITO_PARENT_IMAGE_OWNER} ${INFINITO_PARENT_IMAGE_TAG}" >> "${RECORD}"',
|
||||
INFINITO_CI_DISTRO_BUDGET_SECONDS="600",
|
||||
)
|
||||
self.assertEqual(proc.returncode, 0, proc.stderr)
|
||||
images = dict(line.split() for line in record.splitlines())
|
||||
self.assertEqual(sorted(images), sorted(DISTROS.split()))
|
||||
self.assertEqual(len(set(images.values())), len(images), images)
|
||||
rows = [line.split() for line in record.splitlines()]
|
||||
self.assertEqual(sorted(row[0] for row in rows), sorted(DISTROS.split()))
|
||||
for distro, image, owner, tag in rows:
|
||||
self.assertEqual(image, pkgmgr_image(distro, owner=owner, tag=tag))
|
||||
|
||||
def test_the_command_inherits_the_env_layer(self) -> None:
|
||||
proc, record = self._run(
|
||||
|
||||
Reference in new issue
Block a user