hybrid: Add packages from prepopulate to input

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ář <lsedlar@redhat.com>
This commit is contained in:
Lubomír Sedlář 2019-01-29 12:43:40 +01:00
parent da1ea83561
commit f59034b22d
2 changed files with 20 additions and 2 deletions

View File

@ -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]

View File

@ -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,