Unverified Commit b1aa2d0b authored by Marius van den Beek's avatar Marius van den Beek Committed by GitHub
Browse files

Merge pull request #15040 from davelopez/22.05_fix_display_collection_error

[22.05] Fix display collection error in history items
parents 43bafaf9 fd25b421
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -56,6 +56,7 @@
                    :item-urls="itemUrls"
                    @delete="$emit('delete')"
                    @display="onDisplay"
                    @showCollectionInfo="onShowCollectionInfo"
                    @edit="onEdit"
                    @undelete="$emit('undelete')"
                    @unhide="$emit('unhide')" />
@@ -176,6 +177,10 @@ export default {
            if (this.isCollection) {
                return {
                    edit: `collection/edit/${id}`,
                    showDetails:
                        this.item.job_source_id && this.item.job_source_type === "Job"
                            ? `jobs/${this.item.job_source_id}/view`
                            : null,
                };
            }
            return {
@@ -207,6 +212,9 @@ export default {
        onEdit() {
            backboneRoute(this.itemUrls.edit);
        },
        onShowCollectionInfo() {
            backboneRoute(this.itemUrls.showDetails);
        },
        onTags(newTags) {
            this.$emit("tag-change", this.item, newTags);
            updateContentFields(this.item, { tags: newTags });
+22 −0
Original line number Diff line number Diff line
<template>
    <span class="align-self-start btn-group">
        <!-- Special case for collections -->
        <b-button
            v-if="isCollection && canShowCollectionDetails"
            class="collection-job-details-btn px-1"
            title="Show Details"
            size="sm"
            variant="link"
            :href="showCollectionDetailsUrl"
            @click.prevent.stop="$emit('showCollectionInfo')">
            <icon icon="info-circle" />
        </b-button>

        <!-- Common for all content items -->
        <b-button
            v-if="isDataset"
            :disabled="displayDisabled"
@@ -88,6 +101,15 @@ export default {
        editUrl() {
            return prependPath(this.itemUrls.edit);
        },
        isCollection() {
            return !this.isDataset;
        },
        canShowCollectionDetails() {
            return !!this.itemUrls.showDetails;
        },
        showCollectionDetailsUrl() {
            return prependPath(this.itemUrls.showDetails);
        },
    },
};
</script>
+2 −2
Original line number Diff line number Diff line
<template>
    <div>
        <job-details-provider auto-refresh :jobId="job_id" @update:result="updateJob" />
        <job-details-provider auto-refresh :job-id="job_id" @update:result="updateJob" />
        <h3>Job Information</h3>
        <table id="job-information" class="tabletip info_data_table">
            <tbody>
@@ -46,7 +46,7 @@
                    :code-item="job.traceback" />
                <tr v-if="job">
                    <td>Tool Exit Code:</td>
                    <td id="exist-code">{{ job.exit_code }}</td>
                    <td id="exit-code">{{ job.exit_code }}</td>
                </tr>
                <tr v-if="job && job.job_messages && job.job_messages.length > 0" id="job-messages">
                    <td>Job Messages</td>
+9 −0
Original line number Diff line number Diff line
@@ -179,6 +179,7 @@ history_panel:
      edit_button: '${_} .edit-btn'
      delete_button: '${_} .delete-btn'
      rerun_button: '${_} .rerun-btn'
      collection_job_details_button: '${_} .collection-job-details-btn'

      # Action buttons...
      download_button: '${_} .download-btn'
@@ -944,3 +945,11 @@ charts:
  selectors:
    visualize_button: '.ui-portlet .button i.fa-line-chart'  # without icon - it waits on other buttons that aren't visible, need more specific class
    viewport_canvas: 'svg.charts-viewport-canvas'

job_details:
  selectors:
    galaxy_tool_with_id:
      type: xpath
      selector: '//td[@id="galaxy-tool-id"][normalize-space(text()) = "${tool_id}"]'
    tool_exit_code: '#exit-code'
+31 −0
Original line number Diff line number Diff line
@@ -132,6 +132,24 @@ class HistoryPanelCollectionsTestCase(SeleniumTestCase):
            for job in payload["jobs"]:
                self.dataset_populator.cancel_job(job["id"])

    @selenium_test
    def test_collection_job_details(self):
        ok_collection_hid, failed_collection_hid = self._generate_ok_and_failed_collections()
        ok_collection_element = self.history_panel_wait_for_hid_state(ok_collection_hid, "ok")
        failed_collection_element = self.history_panel_wait_for_hid_state(failed_collection_hid, "error")

        ok_collection_element.collection_job_details_button.wait_for_and_click()
        self.components.job_details.galaxy_tool_with_id(tool_id="collection_creates_list").wait_for_visible()
        tool_exit_code_component = self.components.job_details.tool_exit_code.wait_for_visible()
        self.screenshot("history_panel_collections_job_details_ok")
        assert int(tool_exit_code_component.text) == 0

        failed_collection_element.collection_job_details_button.wait_for_and_click()
        self.components.job_details.galaxy_tool_with_id(tool_id="collection_creates_list_fail").wait_for_visible()
        tool_exit_code_component = self.components.job_details.tool_exit_code.wait_for_visible()
        self.screenshot("history_panel_collections_job_details_failed")
        assert int(tool_exit_code_component.text) > 0

    @selenium_test
    def test_back_to_history_button(self):
        input_collection = self._populated_paired_and_wait_for_it()
@@ -302,3 +320,16 @@ class HistoryPanelCollectionsTestCase(SeleniumTestCase):
        self.history_panel_wait_for_hid_state(collection_hid, "ok")

        return input_collection

    def _generate_ok_and_failed_collections(self):
        history_id = self.current_history_id()
        fetch_response = self.dataset_collection_populator.create_list_in_history(
            history_id, contents=["0", "1", "0", "1"]
        ).json()
        hdca_id = self.dataset_collection_populator.wait_for_fetched_collection(fetch_response)["id"]
        collection_input = {"input1": {"src": "hdca", "id": hdca_id}}
        ok_response = self.dataset_populator.run_tool("collection_creates_list", collection_input, history_id)
        failed_response = self.dataset_populator.run_tool("collection_creates_list_fail", collection_input, history_id)
        ok_collection_hid = ok_response["output_collections"][0]["hid"]
        failed_collection_hid = failed_response["output_collections"][0]["hid"]
        return ok_collection_hid, failed_collection_hid