From 4c83c00592a1946282c920569ccc389b3fc22e11 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Mon, 16 Sep 2024 14:53:30 +0200 Subject: [PATCH] fixup! tweak test to sort refs/remove duplicates to make rpm stage comparable without too much noise --- example/centos/centos-9-x86_64-ami.yaml | 7 ------- test/test_against_images_refs.py | 8 ++++++-- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/example/centos/centos-9-x86_64-ami.yaml b/example/centos/centos-9-x86_64-ami.yaml index 4305476d..54f10443 100644 --- a/example/centos/centos-9-x86_64-ami.yaml +++ b/example/centos/centos-9-x86_64-ami.yaml @@ -21,24 +21,17 @@ otk.define: include: - coreutils - dosfstools - - dosfstools - glibc - grub2-pc - - grub2-pc - platform-python - policycoreutils - - policycoreutils - python3 - python3-pyyaml - - python3-pyyaml - rpm - rpm - selinux-policy-targeted - - selinux-policy-targeted - - selinux-policy-targeted - systemd - xfsprogs - - xfsprogs - xz exclude: [] os: diff --git a/test/test_against_images_refs.py b/test/test_against_images_refs.py index 74f1208f..9f728ad6 100644 --- a/test/test_against_images_refs.py +++ b/test/test_against_images_refs.py @@ -37,8 +37,12 @@ def fixup_references(manifest): for pipeline in manifest["pipelines"]: for stage in pipeline["stages"]: if stage["type"] == "org.osbuild.rpm": - refs = stage["inputs"]["packages"]["references"] - stage["inputs"]["packages"]["references"] = sorted(refs, key=lambda x: x["id"]) + # sort refs/remove duplicates + ids = set(x["id"] + for x in stage["inputs"]["packages"]["references"]) + refs = sorted([{"id": i} + for i in ids], key=lambda x: x["id"]) + stage["inputs"]["packages"]["references"] = refs @pytest.mark.parametrize("tc", reference_manifests())