mirror of
https://pagure.io/fm-orchestrator.git
synced 2026-04-07 12:48:40 +08:00
Remove unused argument arches from add_default_modules
Signed-off-by: Chenxiong Qi <cqi@redhat.com>
This commit is contained in:
@@ -22,7 +22,7 @@ from module_build_service.utils.mse import (
|
||||
get_compatible_base_module_mmds, expand_single_mse_streams)
|
||||
|
||||
|
||||
def add_default_modules(mmd, arches):
|
||||
def add_default_modules(mmd):
|
||||
"""
|
||||
Add default modules as buildrequires to the input modulemd.
|
||||
|
||||
@@ -31,8 +31,6 @@ def add_default_modules(mmd, arches):
|
||||
database will be logged and ignored.
|
||||
|
||||
:param Modulemd.ModuleStream mmd: the modulemd of the module to add the module defaults to
|
||||
:param list arches: the arches to limit the external repo queries to; this should be the arches
|
||||
the module will be built with
|
||||
:raises RuntimeError: if the buildrequired base module isn't in the database or the default
|
||||
modules list can't be downloaded
|
||||
"""
|
||||
|
||||
@@ -157,7 +157,7 @@ def init(config, msg):
|
||||
mmd = build.mmd()
|
||||
record_module_build_arches(mmd, build)
|
||||
arches = [arch.name for arch in build.arches]
|
||||
defaults_added = add_default_modules(mmd, arches)
|
||||
defaults_added = add_default_modules(mmd)
|
||||
|
||||
# Format the modulemd by putting in defaults and replacing streams that
|
||||
# are branches with commit hashes
|
||||
|
||||
@@ -52,7 +52,7 @@ def test_add_default_modules(mock_get_dm, mock_hc):
|
||||
"python": "3",
|
||||
"ruby": "2.6",
|
||||
}
|
||||
defaults_added = default_modules.add_default_modules(mmd, ["x86_64"])
|
||||
defaults_added = default_modules.add_default_modules(mmd)
|
||||
# Make sure that the default modules were added. ruby:2.6 will be ignored since it's not in
|
||||
# the database
|
||||
assert set(mmd.get_xmd()["mbs"]["buildrequires"].keys()) == {"nodejs", "platform", "python"}
|
||||
@@ -72,7 +72,7 @@ def test_add_default_modules_not_linked(mock_get_dm):
|
||||
clean_database()
|
||||
mmd = load_mmd(read_staged_data("formatted_testmodule.yaml"))
|
||||
assert set(mmd.get_xmd()["mbs"]["buildrequires"].keys()) == {"platform"}
|
||||
default_modules.add_default_modules(mmd, ["x86_64"])
|
||||
default_modules.add_default_modules(mmd)
|
||||
assert set(mmd.get_xmd()["mbs"]["buildrequires"].keys()) == {"platform"}
|
||||
mock_get_dm.assert_not_called()
|
||||
|
||||
@@ -88,7 +88,7 @@ def test_add_default_modules_platform_not_available():
|
||||
|
||||
expected_error = "Failed to retrieve the module platform:f28:3:00000000 from the database"
|
||||
with pytest.raises(RuntimeError, match=expected_error):
|
||||
default_modules.add_default_modules(mmd, ["x86_64"])
|
||||
default_modules.add_default_modules(mmd)
|
||||
|
||||
|
||||
@patch("module_build_service.scheduler.default_modules._get_default_modules")
|
||||
@@ -136,7 +136,7 @@ def test_add_default_modules_compatible_platforms(mock_get_dm):
|
||||
"python": "3",
|
||||
"ruby": "2.6",
|
||||
}
|
||||
defaults_added = default_modules.add_default_modules(mmd, ["x86_64"])
|
||||
defaults_added = default_modules.add_default_modules(mmd)
|
||||
# Make sure that the default modules were added. ruby:2.6 will be ignored since it's not in
|
||||
# the database
|
||||
assert set(mmd.get_xmd()["mbs"]["buildrequires"].keys()) == {"nodejs", "platform"}
|
||||
@@ -178,7 +178,7 @@ def test_add_default_modules_request_failed(mock_get_dm):
|
||||
mock_get_dm.side_effect = ValueError(expected_error)
|
||||
|
||||
with pytest.raises(ValueError, match=expected_error):
|
||||
default_modules.add_default_modules(mmd, ["x86_64"])
|
||||
default_modules.add_default_modules(mmd)
|
||||
|
||||
|
||||
@pytest.mark.parametrize("is_rawhide", (True, False))
|
||||
|
||||
Reference in New Issue
Block a user