mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-10-25 00:12:08 +08:00
Fix for testing extra files in tool tests.
Wouldn't be testing if primary file didn't specify a filename to test against.
This commit is contained in:
@@ -613,6 +613,7 @@ def collect_primary_datasets(tool, output, tool_provided_metadata, job_working_d
|
||||
extra_files_path_joined = os.path.join(job_working_directory, extra_files_path)
|
||||
for root, dirs, files in os.walk(extra_files_path_joined):
|
||||
extra_dir = os.path.join(primary_data.extra_files_path, root.replace(extra_files_path_joined, '', 1).lstrip(os.path.sep))
|
||||
extra_dir = os.path.normpath(extra_dir)
|
||||
for f in files:
|
||||
app.object_store.update_from_file(
|
||||
primary_data.dataset,
|
||||
@@ -620,7 +621,6 @@ def collect_primary_datasets(tool, output, tool_provided_metadata, job_working_d
|
||||
alt_name=f,
|
||||
file_name=os.path.join(root, f),
|
||||
create=True,
|
||||
dir_only=True,
|
||||
preserve_symlinks=True
|
||||
)
|
||||
metadata_dict = new_primary_datasets_attributes.get('metadata', None)
|
||||
|
||||
@@ -69,6 +69,9 @@ def verify(
|
||||
errmsg += str(err)
|
||||
raise AssertionError(errmsg)
|
||||
|
||||
if attributes is None:
|
||||
attributes = {}
|
||||
|
||||
if filename is not None:
|
||||
local_name = get_filename(filename)
|
||||
temp_name = make_temp_fname(fname=filename)
|
||||
@@ -88,8 +91,6 @@ def verify(
|
||||
else:
|
||||
log.debug('## GALAXY_TEST_SAVE=%s. saved %s' % (keep_outputs_dir, ofn))
|
||||
try:
|
||||
if attributes is None:
|
||||
attributes = {}
|
||||
compare = attributes.get('compare', 'diff')
|
||||
if attributes.get('ftype', None) in ['bam', 'qname_sorted.bam', 'qname_input_sorted.bam', 'unsorted.bam']:
|
||||
local_fh, temp_name = _bam_to_sam(local_name, temp_name)
|
||||
@@ -110,10 +111,6 @@ def verify(
|
||||
files_contains(local_name, temp_name, attributes=attributes)
|
||||
else:
|
||||
raise Exception('Unimplemented Compare type: %s' % compare)
|
||||
if verify_extra_files:
|
||||
extra_files = attributes.get('extra_files', None)
|
||||
if extra_files:
|
||||
verify_extra_files(extra_files)
|
||||
except AssertionError as err:
|
||||
errmsg = '%s different than expected, difference (using %s):\n' % (item_label, compare)
|
||||
errmsg += "( %s v. %s )\n" % (local_name, temp_name)
|
||||
@@ -123,6 +120,11 @@ def verify(
|
||||
if 'GALAXY_TEST_NO_CLEANUP' not in os.environ:
|
||||
os.remove(temp_name)
|
||||
|
||||
if verify_extra_files:
|
||||
extra_files = attributes.get('extra_files', None)
|
||||
if extra_files:
|
||||
verify_extra_files(extra_files)
|
||||
|
||||
|
||||
def make_temp_fname(fname=None):
|
||||
"""Safe temp name - preserve the file extension for tools that interpret it."""
|
||||
|
||||
Reference in New Issue
Block a user