From ee8d2bd983ddef7a399e2eb79695c4f8ce189b70 Mon Sep 17 00:00:00 2001 From: Kevin Veen-Birkenbach Date: Wed, 14 Oct 2026 01:32:24 +0200 Subject: [PATCH] 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) --- .../unit/python/scripts/tests/deploy/test_distros.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/tests/unit/python/scripts/tests/deploy/test_distros.py b/tests/unit/python/scripts/tests/deploy/test_distros.py index fd9cc2b499..80c4d7903f 100644 --- a/tests/unit/python/scripts/tests/deploy/test_distros.py +++ b/tests/unit/python/scripts/tests/deploy/test_distros.py @@ -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(