Skip to content

Commit

Permalink
fix assumptions of file names
Browse files Browse the repository at this point in the history
  • Loading branch information
bernt-matthias committed Sep 27, 2021
1 parent 739fb1c commit 0a644bf
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions planemo/galaxy/test/actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,16 +125,19 @@ def run_in_config(ctx, config, run=run_galaxy_command, test_data_target_dir=None
ec = test_results.exit_code
structured_data = test_results.structured_data
extra_files = []
# check if tools created extra files in the file_path
# check if tools created extra files in the file_path all files in the files path
# - end with '.dat' or
# - are contained in a directory `dataset_.*_files`
for (path, dirs, files) in os.walk(config.env["GALAXY_CONFIG_OVERRIDE_FILE_PATH"]):
for name in files:
if not (name.endswith(".dat") or re.match('dataset_.*_files', name)):
extra_files += os.path.join(path, name)
if not (name.endswith(".dat") or re.match('.*/dataset_.*_files$', path)):
extra_files.append(os.path.join(path, name))
if len(extra_files) > 0:
msg = f"One of the tested tools wrote to Galaxy's files dir: {extra_files}"
for i in range(len(structured_data["tests"])):
structured_data["tests"][i]["data"]["status"] = "failure"
structured_data["tests"][i]["data"]["job"]["stderr"] += "One of the tested tools wrote to Galaxy's files dir"
error("One of the tested tools wrote to Galaxy's files dir")
structured_data["tests"][i]["data"]["job"]["stderr"] += msg
error(msg)
ec = 1
return handle_reports_and_summary(
ctx,
Expand Down

0 comments on commit 0a644bf

Please sign in to comment.