Skip to content

Commit 364b3bc

Browse files
committed
Add selenium regression test for unset optional data input rerun
Selenium regression for the WorkflowRunFormSimple data-input rerun hydration crash fixed in the prior commit. Runs `WORKFLOW_OPTIONAL_TRUE_INPUT_DATA` without selecting the optional input, then reruns without changes and asserts a new ok output appears. Pre-fix, the rerun submission raised a "Workflow submission failed: ... 'values' not permitted ..." toast because the rerun-hydrated wrapper contained `[null]` and the FormData mounted hook crashed before it could normalize the value. Originally reported on a "1 or 2 haplotypes" workflow where users left the second-haplotype input empty.
1 parent 483c91c commit 364b3bc

1 file changed

Lines changed: 45 additions & 1 deletion

File tree

lib/galaxy_test/selenium/test_workflow_rerun.py

Lines changed: 45 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
from galaxy_test.base.workflow_fixtures import WORKFLOW_SIMPLE_CAT_TWICE
1+
from galaxy_test.base.workflow_fixtures import (
2+
WORKFLOW_OPTIONAL_TRUE_INPUT_DATA,
3+
WORKFLOW_SIMPLE_CAT_TWICE,
4+
)
25
from .framework import (
36
managed_history,
47
retry_assertion_during_transitions,
@@ -136,6 +139,47 @@ def test_workflow_rerun_preserves_false_boolean_parameter(self):
136139
self._assert_input_table_has_parameter("bool_param", "true")
137140
self.screenshot("workflow_rerun_boolean_inputs_tab")
138141

142+
@selenium_test
143+
@managed_history
144+
def test_workflow_rerun_with_unset_optional_data_input(self):
145+
"""Regression test for workflow rerun crashing when an optional data_input was left empty.
146+
147+
When a workflow has an optional ``data_input`` step that the user did
148+
not provide on the original run, ``WorkflowInvocationRequestModel.inputs``
149+
returns ``null`` for that step. WorkflowRunFormSimple.vue used to wrap
150+
the value as ``{values: [null]}`` regardless, which crashed the
151+
``FormData`` mounted hook on ``"src" in null``. Because the mounted
152+
hook never completed, the bad wrapper survived in formData and was
153+
sent to the server, which rejected it with a ``DataOrCollectionRequest``
154+
union ValidationError ("Extra inputs are not permitted in 'values'").
155+
Reported on a "1 or 2 haplotypes" workflow where the second haplotype
156+
was left empty.
157+
"""
158+
invocations = self.components.invocations
159+
160+
# Upload one HDA so the history isn't empty (the workflow form needs a
161+
# current history); the optional input is intentionally left unselected.
162+
self.perform_upload(self.get_filename("1.fasta"))
163+
self.wait_for_history()
164+
self.workflow_run_open_workflow(WORKFLOW_OPTIONAL_TRUE_INPUT_DATA)
165+
# Submit without touching the optional input so it goes to the server as null.
166+
self.workflow_run_submit()
167+
self.sleep_for(self.wait_types.UX_TRANSITION)
168+
self.workflow_run_wait_for_ok(hid=2, expand=True)
169+
170+
# Submitting lands us on the new invocation page; click rerun directly.
171+
invocations.state_details.wait_for_visible()
172+
invocations.workflow_rerun_button.wait_for_and_click()
173+
self.sleep_for(self.wait_types.UX_TRANSITION)
174+
175+
# Submit the rerun without touching anything. Pre-fix this raises a
176+
# "Workflow submission failed: ... 'values' not permitted ..." toast
177+
# because formData carries the poisoned `{values: [null]}` wrapper.
178+
self.workflow_run_submit()
179+
self.sleep_for(self.wait_types.UX_TRANSITION)
180+
self.workflow_run_wait_for_ok(hid=3, expand=True)
181+
self.screenshot("workflow_rerun_unset_optional_data_input_submitted")
182+
139183
@retry_assertion_during_transitions
140184
def _assert_input_table_has_parameter(self, label: str, value: str):
141185
table = self.wait_for_selector('[data-description="input table"]')

0 commit comments

Comments
 (0)