From f59034b22d4d6460b1086fa59194121a6eaa9549 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubom=C3=ADr=20Sedl=C3=A1=C5=99?= Date: Tue, 29 Jan 2019 12:43:40 +0100 Subject: [PATCH] hybrid: Add packages from prepopulate to input MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is really an oversight. The list of packages from prepopulate list should be treated the same as if the packagees were coming from comps or additional packages. Signed-off-by: Lubomír Sedlář --- pungi/phases/gather/methods/method_hybrid.py | 3 +++ tests/test_gather_method_hybrid.py | 19 +++++++++++++++++-- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/pungi/phases/gather/methods/method_hybrid.py b/pungi/phases/gather/methods/method_hybrid.py index 0dcde6f6..d996236c 100644 --- a/pungi/phases/gather/methods/method_hybrid.py +++ b/pungi/phases/gather/methods/method_hybrid.py @@ -162,6 +162,7 @@ class GatherMethodHybrid(pungi.phases.gather.method.GatherMethodBase): multilib_whitelist=[], multilib_blacklist=[], filter_packages=[], + prepopulate=[], **kwargs ): self.arch = arch @@ -186,6 +187,8 @@ class GatherMethodHybrid(pungi.phases.gather.method.GatherMethodBase): expand_groups(self.compose, arch, variant, groups, set_pkg_arch=False) ) + packages.update(tuple(pkg.rsplit(".", 1)) for pkg in prepopulate) + # Filters are received as tuples (name, arch), we should convert it to # strings. filter_packages = [_fmt_pkg(*p) for p in filter_packages] diff --git a/tests/test_gather_method_hybrid.py b/tests/test_gather_method_hybrid.py index 2e355e30..1abb5aed 100644 --- a/tests/test_gather_method_hybrid.py +++ b/tests/test_gather_method_hybrid.py @@ -48,13 +48,28 @@ class TestMethodHybrid(helpers.PungiTestCase): arch = "x86_64" variant = compose.variants["Server"] - res = m(arch, variant, package_sets, set(["pkg"]), ["standard"]) + res = m( + arch, + variant, + package_sets, + set(["pkg"]), + ["standard"], + prepopulate=["prep.noarch"], + ) self.assertEqual(res, ep.return_value) self.assertEqual(cmr.call_args_list, [mock.call(compose, variant, arch)]) self.assertEqual( m.run_solver.call_args_list, - [mock.call(variant, arch, set(["pkg", "foo", "bar"]), cmr.return_value, [])], + [ + mock.call( + variant, + arch, + set(["pkg", "foo", "bar", ("prep", "noarch")]), + cmr.return_value, + [], + ) + ], ) self.assertEqual( ep.call_args_list,