From c2e504882147594528088ecffb30197d399963a8 Mon Sep 17 00:00:00 2001 From: Jakub Kadlcik Date: Apr 07 2021 09:38:19 +0000 Subject: frontend: test that we can set these options via API Fix #1748 - follow_fedora_branching and - runtime_dependencies - bootstrap (bootstrap_image is ignored though because it is a chroot setting, not project setting) This issue was IMHO fixed in PR#1708, I am merely adding tests. --- diff --git a/frontend/coprs_frontend/tests/test_apiv3/test_projects.py b/frontend/coprs_frontend/tests/test_apiv3/test_projects.py index 29aed7c..39db723 100644 --- a/frontend/coprs_frontend/tests/test_apiv3/test_projects.py +++ b/frontend/coprs_frontend/tests/test_apiv3/test_projects.py @@ -67,7 +67,7 @@ class TestApiv3Projects(CoprsTestCase): @pytest.mark.usefixtures("f_u1_ts_client", "f_mock_chroots", "f_db") def test_update_copr_api3(self): self.web_ui.new_project("test", ["fedora-rawhide-i386"], - bootstrap="image", isolation="simple", + bootstrap="default", isolation="simple", contact="somebody@redhat.com", homepage="https://github.com/fedora-copr") old_data = self._get_copr_id_data(1) @@ -76,6 +76,7 @@ class TestApiv3Projects(CoprsTestCase): # testing method! already_tested = set([ "delete_after", "build_enable_net", "auto_createrepo", "repos", + "runtime_dependencies", ]) # check non-trivial changes @@ -85,10 +86,13 @@ class TestApiv3Projects(CoprsTestCase): assert old_data["module_hotfixes"] is False assert old_data["fedora_review"] is False assert old_data["repos"] == '' + assert old_data["runtime_dependencies"] == "" assert old_data["auto_prune"] is False # TODO: issue 1747 self.api3.modify_project( "test", delete_after_days=5, enable_net=True, devel_mode=True, repos=["http://example/repo/", "http://another/"], + runtime_dependencies=["http://run1/repo/", "http://run2/"], + bootstrap_image="noop", ) new_data = self._get_copr_id_data(1) delete_after = datetime.datetime.now() + datetime.timedelta(days=5) @@ -97,6 +101,8 @@ class TestApiv3Projects(CoprsTestCase): old_data["build_enable_net"] = True old_data["auto_createrepo"] = False old_data["repos"] = "http://example/repo/\nhttp://another/" + old_data["runtime_dependencies"] = "http://run1/repo/\nhttp://run2/" + old_data["bootstrap"] = "default" assert old_data == new_data old_data = new_data @@ -127,10 +133,10 @@ class TestApiv3Projects(CoprsTestCase): }, { "fedora_review": True, }, { - # TODO: issue#1748 - # "bootstrap": "custom_image", - # "bootstrap_image": "centos:6", - #}, { + "follow_fedora_branching": False, + }, { + "follow_fedora_branching": True, + }, { }] for setup in easy_changes: @@ -148,10 +154,6 @@ class TestApiv3Projects(CoprsTestCase): ]: should_test.remove(item) - # TODO: issue#1748 - for item in ['follow_fedora_branching', 'runtime_dependencies']: - should_test.remove(item) - assert already_tested == should_test for case in easy_changes: diff --git a/python/copr/v3/proxies/project.py b/python/copr/v3/proxies/project.py index 5723c7d..ce67991 100644 --- a/python/copr/v3/proxies/project.py +++ b/python/copr/v3/proxies/project.py @@ -99,6 +99,7 @@ class ProjectProxy(BaseProxy): Possible values are 'default', 'on', 'off', 'image'. :param str bootstrap_image: Name of the container image to initialize the bootstrap chroot from. This also implies 'bootstrap=image'. + This is a noop parameter and its value is ignored. :param str isolation: Mock isolation feature setup. Possible values are 'default', 'simple', 'nspawn'. :param bool fedora_review: Run fedora-review tool for packages @@ -170,6 +171,7 @@ class ProjectProxy(BaseProxy): Possible values are 'default', 'simple', 'nspawn'. :param str bootstrap_image: Name of the container image to initialize the bootstrap chroot from. This also implies 'bootstrap=image'. + This is a noop parameter and its value is ignored. :param bool fedora_review: Run fedora-review tool for packages in this project :return: Munch