diff --git a/planemo/galaxy/test/actions.py b/planemo/galaxy/test/actions.py index 1b9777e6d..856f3d29f 100644 --- a/planemo/galaxy/test/actions.py +++ b/planemo/galaxy/test/actions.py @@ -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,