Skip to content

Commit

Permalink
Add test to make sure when_expression is not lost on refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
mvdbeek committed Jun 27, 2024
1 parent 9421bcd commit fa66411
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions test/integration/test_workflow_refactoring.py
Original file line number Diff line number Diff line change
Expand Up @@ -537,6 +537,33 @@ def test_tool_version_upgrade_no_state_change(self):
assert len(action_executions[0].messages) == 0
assert self._latest_workflow.step_by_label("the_step").tool_version == "0.2"

def test_tool_version_upgrade_keeps_when_expression(self):
self.workflow_populator.upload_yaml_workflow(
"""
class: GalaxyWorkflow
inputs:
the_bool:
type: boolean
steps:
the_step:
tool_id: multiple_versions
tool_version: '0.1'
state:
inttest: 0
when: $inputs.the_bool
"""
)
assert self._latest_workflow.step_by_label("the_step").tool_version == "0.1"
actions: ActionsJson = [
{"action_type": "upgrade_tool", "step": {"label": "the_step"}},
]
action_executions = self._refactor(actions).action_executions
assert len(action_executions) == 1
assert len(action_executions[0].messages) == 0
step = self._latest_workflow.step_by_label("the_step")
assert step.tool_version == "0.2"
assert step.when_expression

def test_tool_version_upgrade_state_added(self):
self.workflow_populator.upload_yaml_workflow(
"""
Expand Down

0 comments on commit fa66411

Please sign in to comment.