Unverified Commit 5093aec4 authored by mvdbeek's avatar mvdbeek
Browse files

Fix version flicker on job rerun

Fixes https://github.com/galaxyproject/galaxy/issues/19477,
which should be a problem for built-in tools where the rerun shouldn't
use the latest version. This is because built-in tools don't contain the
version in the tool id, and we didnt' persist the verson in the ToolForm
data. Made worse by https://github.com/galaxyproject/galaxy/issues/18848#issuecomment-2393830406
parent 9a61e3ce
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -305,6 +305,7 @@ export default {
            console.debug("ToolForm - Requesting tool.", this.id);
            return getToolFormData(this.id, this.currentVersion, this.job_id, this.history_id)
                .then((data) => {
                    this.currentVersion = data.version;
                    this.formConfig = data;
                    this.remapAllowed = this.job_id && data.job_remap;
                    this.showForm = true;
+1 −0
Original line number Diff line number Diff line
@@ -595,6 +595,7 @@ tool_form:
    drilldown_select_all: 'div.ui-form-element[id="form-element-${parameter}"] div.select-all-checkbox'
    drilldown_option: '.drilldown-option'
    drilldown_expand: '.fa-caret-down'
    tool_version_button: ".tool-versions"

  labels:
    generate_tour: 'Generate Tour'
+21 −0
Original line number Diff line number Diff line
@@ -170,6 +170,20 @@ class TestToolForm(SeleniumTestCase, UsesHistoryItemAssertions):
        self.history_panel_wait_for_hid_ok(2)
        self._check_dataset_details_for_inttest_value(2)

    @selenium_test
    def test_rerun_with_non_latest_version(self):
        version = "0.1+galaxy6"
        self._run_multiple_version_test_tool(version)
        self.history_panel_wait_for_hid_ok(1)
        self.hda_click_primary_action_button(1, "rerun")
        self.components.tool_form.tool_version_button.wait_for_and_click()
        menu_element = self.wait_for_selector_visible(".dropdown-menu.show")
        menu_options = menu_element.find_elements(By.CSS_SELECTOR, "a.dropdown-item")
        for menu_option in menu_options:
            if f"Selected {version}" in menu_option.text:
                return
        raise Exception("Tool version does not match job version")

    @selenium_test
    def test_rerun_deleted_dataset(self):
        # upload a first dataset that should not become selected on re-run
@@ -314,6 +328,13 @@ class TestToolForm(SeleniumTestCase, UsesHistoryItemAssertions):
        self.tool_set_value("inttest", inttest_value)
        self.tool_form_execute()

    def _run_multiple_version_test_tool(self, version):
        self.home()
        self.tool_open("multiple_versions")
        self.components.tool_form.tool_version_button.wait_for_and_click()
        self.select_dropdown_item(f"Switch to {version}")
        self.tool_form_execute()


class TestLoggedInToolForm(SeleniumTestCase):
    ensure_registered = True