pkgset: Apply module filters on pkgset level

If a module says to filter a package out, we can do it immediately when
getting the build information from Koji.

This avoids a possible problem of something pulling the module package
in as a dependency, but it should also make the package set slightly
smaller.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
This commit is contained in:
Lubomír Sedlář 2018-06-25 14:35:32 +02:00
parent 470c0ab3be
commit 98e7106f3e
3 changed files with 86 additions and 15 deletions

View file

@ -113,11 +113,23 @@ class TestPopulateGlobalPkgset(helpers.PungiTestCase):
self.assertIs(pkgset, orig_pkgset)
self.assertEqual(
pkgset.mock_calls,
[mock.call.populate('f25', 123456, inherit=True,
logfile=self.topdir + '/logs/global/packages_from_f25.global.log'),
mock.call.save_file_list(self.topdir + '/work/global/package_list/global.conf',
remove_path_prefix='/prefix'),
mock.call.save_file_cache(self.topdir + '/work/global/pkgset_file_cache.pickle')])
[
mock.call.populate(
'f25',
123456,
inherit=True,
logfile=self.topdir + '/logs/global/packages_from_f25.global.log',
exclude_packages=None,
),
mock.call.save_file_list(
self.topdir + '/work/global/package_list/global.conf',
remove_path_prefix='/prefix',
),
mock.call.save_file_cache(
self.topdir + '/work/global/pkgset_file_cache.pickle'
),
]
)
self.assertItemsEqual(pickle_dumps.call_args_list,
[mock.call(orig_pkgset)])
with open(self.pkgset_path) as f:
@ -211,10 +223,28 @@ data:
self.compose, self.koji_wrapper, '/prefix', 123456)
self.assertIs(pkgset, orig_pkgset)
pkgset.assert_has_calls([mock.call.populate('f25', 123456, inherit=True,
logfile=self.topdir + '/logs/global/packages_from_f25.global.log')])
pkgset.assert_has_calls([mock.call.populate('f25-extra', 123456, inherit=True,
logfile=self.topdir + '/logs/global/packages_from_f25-extra.global.log')])
pkgset.assert_has_calls(
[
mock.call.populate(
'f25',
123456,
inherit=True,
logfile=self.topdir + '/logs/global/packages_from_f25.global.log',
exclude_packages=None,
),
]
)
pkgset.assert_has_calls(
[
mock.call.populate(
'f25-extra',
123456,
inherit=True,
logfile=self.topdir + '/logs/global/packages_from_f25-extra.global.log',
exclude_packages=None,
),
]
)
pkgset.assert_has_calls([mock.call.save_file_list(self.topdir + '/work/global/package_list/global.conf',
remove_path_prefix='/prefix')])
# for each tag, call pkgset.fast_merge once for each variant and once for global pkgset