From 8078dab412d9c1fc61d4286dc5f073fca2897aec Mon Sep 17 00:00:00 2001 From: Simon Bray Date: Wed, 9 Feb 2022 15:15:39 +0100 Subject: [PATCH] fix small bug in toolbox's get_tool() so non-shed tool can be used for missing tool workflow invocation test --- lib/galaxy/tool_util/toolbox/base.py | 2 +- lib/galaxy_test/api/test_workflows.py | 16 +++++++--------- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/lib/galaxy/tool_util/toolbox/base.py b/lib/galaxy/tool_util/toolbox/base.py index 734971aea46..eed2134d34a 100644 --- a/lib/galaxy/tool_util/toolbox/base.py +++ b/lib/galaxy/tool_util/toolbox/base.py @@ -594,7 +594,7 @@ class AbstractToolBox(Dictifiable, ManagesIntegratedToolPanelMixin): return self._tools_by_id[tool_id] elif tool_version in self._tool_versions_by_id[tool_id]: return self._tool_versions_by_id[tool_id][tool_version] - elif exact: + if exact: # We're looking for an exact match, so we skip lineage and # versionless mapping, though we may want to check duplicate # toolsheds diff --git a/lib/galaxy_test/api/test_workflows.py b/lib/galaxy_test/api/test_workflows.py index 8b355ebe6ff..7d7fc24b903 100644 --- a/lib/galaxy_test/api/test_workflows.py +++ b/lib/galaxy_test/api/test_workflows.py @@ -20,7 +20,6 @@ from galaxy_test.base.populators import ( wait_on, WorkflowPopulator ) -from galaxy_test.base.uses_shed import UsesShed from galaxy_test.base.workflow_fixtures import ( WORKFLOW_NESTED_REPLACEMENT_PARAMETER, WORKFLOW_NESTED_RUNTIME_PARAMETER, @@ -209,7 +208,7 @@ input1: # - Allow post to workflows//run in addition to posting to # /workflows with id in payload. # - Much more testing obviously, always more testing. -class WorkflowsApiTestCase(BaseWorkflowsApiTestCase, ChangeDatatypeTestCase, UsesShed): +class WorkflowsApiTestCase(BaseWorkflowsApiTestCase, ChangeDatatypeTestCase): def test_show_valid(self): workflow_id = self.workflow_populator.simple_workflow("dummy") workflow_id = self.workflow_populator.simple_workflow("test_regular") @@ -876,7 +875,6 @@ steps: assert invocation["state"] == "scheduled", invocation def test_run_workflow_with_missing_tool(self): - self.install_repository("iuc", "compose_text_param", "feb3acba1e0a") # 0.1.0 with self.dataset_populator.test_history() as history_id: workflow_id = self._upload_yaml_workflow(""" class: GalaxyWorkflow @@ -886,21 +884,21 @@ steps: tool_version: "0.1" label: nonexistent compose_text_param: - tool_id: compose_text_param - tool_version: 0.0.1 - label: compose_text_param + tool_id: multiple_versions + tool_version: 0.3 + label: multiple_versions """ ) - # should fail and return both tool ids since version 0.0.1 of compose_text_param does not exist + # should fail and return both tool ids since version 0.3 of multiple_versions does not exist invocation_response = self.__invoke_workflow( workflow_id, history_id=history_id, assert_ok=False, request={"require_exact_tool_versions": True} ) self._assert_status_code_is(invocation_response, 400) self.assertEqual( invocation_response.json().get("err_msg"), - "Workflow was not invoked; the following required tools are not installed: nonexistent_tool (version 0.1), compose_text_param (version 0.0.1)", + "Workflow was not invoked; the following required tools are not installed: nonexistent_tool (version 0.1), multiple_versions (version 0.3)", ) - # should fail but return only the tool_id of non_existent tool as another version of compose_text_param is installed + # should fail but return only the tool_id of non_existent tool as another version of multiple_versions is installed invocation_response = self.__invoke_workflow( workflow_id, history_id=history_id, assert_ok=False, request={"require_exact_tool_versions": False} )