mirror of
https://pagure.io/fm-orchestrator.git
synced 2026-04-05 03:38:12 +08:00
Make repo_include_all setting configurable in xmd
Previously MBS configured all Koji build tags with repo_include_all=True extra option. But for some modules it was desired to be able to have tags with repo_include_all=False. Fixes #957
This commit is contained in:
@@ -838,6 +838,10 @@ chmod 644 %buildroot/etc/rpm/macros.zz-modules
|
||||
'repo_include_all': True,
|
||||
}
|
||||
|
||||
xmd = self.mmd.get_xmd()
|
||||
if "mbs_options" in xmd.keys() and "repo_include_all" in xmd["mbs_options"].keys():
|
||||
opts['extra']['repo_include_all'] = xmd["mbs_options"]["repo_include_all"]
|
||||
|
||||
# edit tag with opts
|
||||
self.koji_session.editTag2(tag_name, **opts)
|
||||
return self._get_tag(tag_name) # Return up2date taginfo
|
||||
|
||||
@@ -414,7 +414,8 @@ class TestKojiBuilder:
|
||||
|
||||
@pytest.mark.parametrize('blocklist', [False, True])
|
||||
@pytest.mark.parametrize('custom_whitelist', [False, True])
|
||||
def test_buildroot_connect(self, custom_whitelist, blocklist):
|
||||
@pytest.mark.parametrize('repo_include_all', [False, True])
|
||||
def test_buildroot_connect(self, custom_whitelist, blocklist, repo_include_all):
|
||||
if blocklist:
|
||||
mmd = self.module.mmd()
|
||||
xmd = glib.from_variant_dict(mmd.get_xmd())
|
||||
@@ -429,6 +430,15 @@ class TestKojiBuilder:
|
||||
mmd.set_buildopts(opts)
|
||||
self.module.modulemd = mmd.dumps()
|
||||
|
||||
if repo_include_all is False:
|
||||
mmd = self.module.mmd()
|
||||
xmd = glib.from_variant_dict(mmd.get_xmd())
|
||||
mbs_options = xmd["mbs_options"] if "mbs_options" in xmd.keys() else {}
|
||||
mbs_options["repo_include_all"] = False
|
||||
xmd["mbs_options"] = mbs_options
|
||||
mmd.set_xmd(glib.dict_values(xmd))
|
||||
self.module.modulemd = mmd.dumps()
|
||||
|
||||
builder = FakeKojiModuleBuilder(
|
||||
owner=self.module.owner, module=self.module, config=conf, tag_name='module-foo',
|
||||
components=["nginx"])
|
||||
@@ -466,6 +476,14 @@ class TestKojiBuilder:
|
||||
expected_calls = []
|
||||
assert session.packageListBlock.mock_calls == expected_calls
|
||||
|
||||
expected_calls = [mock.call('module-foo', arches='i686 armv7hl x86_64',
|
||||
extra={'mock.package_manager': 'dnf',
|
||||
'repo_include_all': repo_include_all}),
|
||||
mock.call('module-foo-build', arches='i686 armv7hl x86_64',
|
||||
extra={'mock.package_manager': 'dnf',
|
||||
'repo_include_all': repo_include_all})]
|
||||
assert session.editTag2.mock_calls == expected_calls
|
||||
|
||||
@pytest.mark.parametrize('blocklist', [False, True])
|
||||
def test_buildroot_connect_create_tag(self, blocklist):
|
||||
if blocklist:
|
||||
|
||||
Reference in New Issue
Block a user