Fix model operations that produce datasets for 78babab645

Should only affect unzip I think - fixes #5780 - probably need to rebuild collections though, collections built in the meantime are going to be broken in the DB.

Includes test case that fails against 18.01.
This commit is contained in:
John Chilton
2018-03-26 14:35:49 -04:00
parent 6fb738b01a
commit ff0f0b6112
2 changed files with 12 additions and 1 deletions
@@ -69,5 +69,12 @@ class ModelOperationToolAction(DefaultToolAction):
def _produce_outputs(self, trans, tool, out_data, output_collections, incoming, history, tags):
tool.produce_outputs(trans, out_data, output_collections, incoming, history=history, tags=tags)
mapped_over_elements = output_collections.dataset_collection_elements
if mapped_over_elements:
for name, value in out_data.items():
if name in mapped_over_elements:
value.visible = False
mapped_over_elements[name].hda = value
trans.sa_session.add_all(out_data.values())
trans.sa_session.flush()
+5 -1
View File
@@ -168,7 +168,11 @@ class ToolsTestCase(api.ApiTestCase):
}
}
self.dataset_populator.wait_for_history(history_id, assert_ok=True)
self._run("__UNZIP_COLLECTION__", history_id, inputs, assert_ok=True)
response = self._run("__UNZIP_COLLECTION__", history_id, inputs, assert_ok=True)
implicit_collections = response["implicit_collections"]
self.assertEquals(len(implicit_collections), 2)
unzipped_hdca = self.dataset_populator.get_history_collection_details(history_id, hid=implicit_collections[0]["hid"])
assert unzipped_hdca["elements"][0]["element_type"] == "hda", unzipped_hdca
def test_zip_inputs(self):
with self.dataset_populator.test_history() as history_id: