From 34dcced045f56ed4d741bd27cc66a81691474533 Mon Sep 17 00:00:00 2001 From: Simon Bray Date: Fri, 28 Jul 2023 17:11:04 +0200 Subject: [PATCH 1/3] adjust test_data_download method in GalaxyInteractorApi so an admin user is not required --- lib/galaxy/tool_util/verify/interactor.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/galaxy/tool_util/verify/interactor.py b/lib/galaxy/tool_util/verify/interactor.py index f66b5959cc16..590be725a9d9 100644 --- a/lib/galaxy/tool_util/verify/interactor.py +++ b/lib/galaxy/tool_util/verify/interactor.py @@ -453,9 +453,7 @@ def test_data_download(self, tool_id, filename, mode="file", is_output=True, too if self.supports_test_data_download: version_fragment = f"&tool_version={tool_version}" if tool_version else "" - response = self._get( - f"tools/{tool_id}/test_data_download?filename={filename}{version_fragment}", admin=True - ) + response = self._get(f"tools/{tool_id}/test_data_download?filename={filename}{version_fragment}") if response.status_code == 200: if mode == "file": result = response.content From 77c0e915b0de6c45e638f515cae86aeac6fea965 Mon Sep 17 00:00:00 2001 From: Matthias Bernt Date: Fri, 28 Jul 2023 10:28:04 +0200 Subject: [PATCH 2/3] fix regex for profile version - did not allow for new style profile versions (that may have only a single digit after the dot) - fix: do not allow `,` in profile version --- lib/galaxy/tool_util/linters/general.py | 2 +- test/unit/tool_util/test_tool_linters.py | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/lib/galaxy/tool_util/linters/general.py b/lib/galaxy/tool_util/linters/general.py index ed87a611da2c..73fd6b73621f 100644 --- a/lib/galaxy/tool_util/linters/general.py +++ b/lib/galaxy/tool_util/linters/general.py @@ -13,7 +13,7 @@ ERROR_ID_MSG = "Tool does not define an id attribute." VALID_ID_MSG = "Tool defines an id [%s]." -PROFILE_PATTERN = re.compile(r"^[1,2]\d\.[0,1]\d$") +PROFILE_PATTERN = re.compile(r"^[12]\d\.(01|05|09|\d)$") PROFILE_INFO_DEFAULT_MSG = "Tool targets 16.01 Galaxy profile." PROFILE_INFO_SPECIFIED_MSG = "Tool specifies profile version [%s]." PROFILE_INVALID_MSG = "Tool specifies an invalid profile version [%s]." diff --git a/test/unit/tool_util/test_tool_linters.py b/test/unit/tool_util/test_tool_linters.py index e9ea77589cfd..0873b9ea67a8 100644 --- a/test/unit/tool_util/test_tool_linters.py +++ b/test/unit/tool_util/test_tool_linters.py @@ -109,6 +109,11 @@ """ +GENERAL_VALID_NEW_PROFILE_FMT = """ + + +""" + # test tool xml for help linter HELP_MULTIPLE = """ @@ -1016,6 +1021,19 @@ def test_general_valid(lint_ctx): assert not lint_ctx.error_messages +def test_general_valid_new_profile_fmt(lint_ctx): + tool_source = get_xml_tool_source(GENERAL_VALID_NEW_PROFILE_FMT) + run_lint(lint_ctx, general.lint_general, XmlToolSource(tool_source)) + assert "Tool defines a version [1.0+galaxy1]." in lint_ctx.valid_messages + assert "Tool specifies profile version [23.0]." in lint_ctx.valid_messages + assert "Tool defines an id [valid_id]." in lint_ctx.valid_messages + assert "Tool defines a name [valid name]." in lint_ctx.valid_messages + assert not lint_ctx.info_messages + assert len(lint_ctx.valid_messages) == 4 + assert not lint_ctx.warn_messages + assert not lint_ctx.error_messages + + def test_help_multiple(lint_ctx): tool_source = get_xml_tool_source(HELP_MULTIPLE) run_lint(lint_ctx, help.lint_help, tool_source) From 4f3b8da9f11e0b082511f2ce7a3223f784928f12 Mon Sep 17 00:00:00 2001 From: Matthias Bernt Date: Fri, 28 Jul 2023 18:57:41 +0200 Subject: [PATCH 3/3] make pattern even more flexible since in the past releases were quite irregular --- lib/galaxy/tool_util/linters/general.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/galaxy/tool_util/linters/general.py b/lib/galaxy/tool_util/linters/general.py index 73fd6b73621f..7012033c1637 100644 --- a/lib/galaxy/tool_util/linters/general.py +++ b/lib/galaxy/tool_util/linters/general.py @@ -13,7 +13,7 @@ ERROR_ID_MSG = "Tool does not define an id attribute." VALID_ID_MSG = "Tool defines an id [%s]." -PROFILE_PATTERN = re.compile(r"^[12]\d\.(01|05|09|\d)$") +PROFILE_PATTERN = re.compile(r"^[12]\d\.\d{1,2}$") PROFILE_INFO_DEFAULT_MSG = "Tool targets 16.01 Galaxy profile." PROFILE_INFO_SPECIFIED_MSG = "Tool specifies profile version [%s]." PROFILE_INVALID_MSG = "Tool specifies an invalid profile version [%s]."