Tweak pre-creating empty outputs to fix #8756.

This commit is contained in:
John Chilton
2019-10-25 09:12:43 -04:00
parent c327f9bf3d
commit 1dbbaa68fa
3 changed files with 19 additions and 5 deletions
+1 -1
View File
@@ -54,7 +54,7 @@ class BaseToolProvidedMetadata(object):
def has_failed_outputs(self):
"""Determine if generation of any of the outputs failed.
If True, this method should also log information about at the first such failed output.
If True, this method should also log information about at least the first such failed output.
"""
return False
+6 -4
View File
@@ -332,10 +332,12 @@ class ToolEvaluator(object):
# Write outputs to the working directory (for security purposes)
# if desired.
param_dict[name] = DatasetFilenameWrapper(hda, compute_environment=self.compute_environment, io_type="output")
try:
open(str(param_dict[name]), 'w').close()
except EnvironmentError:
pass # May well not exist - e.g. Pulsar.
output_path = str(param_dict[name])
# Conditionally create empty output:
# - may already exist (e.g. symlink output)
# - parent directory might not exist (e.g. Pulsar)
if not os.path.exists(output_path) and os.path.exists(os.path.dirname(output_path)):
open(output_path, 'w').close()
# Provide access to a path to store additional files
# TODO: move compute path logic into compute environment, move setting files_path
@@ -213,6 +213,18 @@ class AdminsCanPasteFilePathsTestCase(BaseUploadContentConfigurationTestCase):
# Test regression where this was getting deleted in this mode.
assert os.path.exists(path)
def test_admin_path_paste_libraries_link(self):
library = self.library_populator.new_private_library("pathpasteallowedlibraries")
path = "%s/1.txt" % TEST_DATA_DIRECTORY
assert os.path.exists(path)
payload, files = self.library_populator.create_dataset_request(library, upload_option="upload_paths", paths=path, link_data=True)
response = self.library_populator.raw_library_contents_create(library["id"], payload, files=files)
assert response.status_code == 200
assert os.path.exists(path)
self.library_populator.wait_on_library_dataset(library, response.json()[0])
# We should probably verify the linking, but this was enough for now to exhibit
# https://github.com/galaxyproject/galaxy/issues/8756
def test_admin_fetch(self):
path = os.path.join(TEST_DATA_DIRECTORY, "1.txt")
elements = [{"src": "path", "path": path}]